-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump substrate v0.9.28 and add a MeetupResult
in the IssuedRewards
storage.
#274
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments. Otherwise, it looks good.
@pifragile you might also want to have a look at this.
Further, I am considering of changing the paradigm, such that we also have branch = polkadot-v9.x.x
on master. Do you have any objections here @pifragile?
info!(target: LOG, "marking issuance as completed for failed meetup."); | ||
|
||
<IssuedRewards<T>>::insert((cid, cindex), meetup_index, meetup_result); | ||
return Ok(Pays::No.into()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also return the error here. Otherwise, the user expects some rewards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we return an error, the storage (IssuedRewards) will not be updated. We did these changes to fix it: #275
The "error" feedback is in the MeetupResult:
MeetupResult::VotesNotDependable or MeetupResult::MeetupValidationIndexOutOfBounds. Perhaps we can improve the name: MeetupResult::VotesNotDependableError, MeetupResult::MeetupValidationIndexOutOfBoundsError ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry, I completely forgot that this was the cause of this PR. In that case, we should additionally add an event:
MeetupEvaluated(MeetupResult)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny remark, which will lead you to revert some stuff here. :)
ceremonies/src/lib.rs
Outdated
Option<MeetupResult>, | ||
ValueQuery, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of making this an Option<MeetupResult>
, you should change ValueQuery
to OptionQuery
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me now!
let meetup_result = IssuedRewards::<TestRuntime>::get((cid, cindex), 1); | ||
assert_eq!(meetup_result, Some(MeetupResult::VotesNotDependable)); | ||
|
||
assert!(event_deposited::<TestRuntime>( | ||
Event::MeetupEvaluated(cid, 1, MeetupResult::VotesNotDependable).into() | ||
)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
MeetupResult
in the IssuedRewards
storage.
sorry i completely missed this @clangenb |
Upgrade to polkadot-v0.9.28 :
Reasoning for adding the
MeetupResult
:Failing calls do no longer change the storage, see #275. So we had to change the dispatch result to be OK, but in turn we store the
MeetupResult
inIssuedRewards
instead of just a plain()
. This is anyhow helpful information for client applications. Further, an event is emitted when a failing meetup is evaluated.