-
Notifications
You must be signed in to change notification settings - Fork 769
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
Adding try_state
hook for Tips pallet
#1871
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.
(We should not invest much effort into this pallet since it is Gov1)
Not sure if this is actually correct, since DataDepositPerByte
and TipReportDepositBase
can be configured to zero.
Maybe also add a check to the integrity_test
that TipReportDepositBase
is not zero since otherwise it does not take a deposit for the entry into the Reasons
and Tips
map.
Another invariant would be that the Reason
for each Tips
exists.
@ggwpez Thanks for the review
Noted
🤝 will include this.
I previously included this as an Invariant here, seems like it's universal logic in the function calls and also tests for this would always pass. |
try_state
hook for Tips pallet
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.
Added a couple of comments, but approving. thanks!
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
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.
LGTM, lets get it merged soon. Its open since quite a while now 😅
Part of paritytech#239. Invariant 1. The number of entries in `Tips` should be equal to `Reasons`. 2. If `OpenTip.finders_fee` is true, then `OpenTip.deposit` should be greater than zero. 3. Reasons exists for each Tip[`OpenTip.reason`], implying equal length of storage. polkadot address: 12zsKEDVcHpKEWb99iFt3xrTCQQXZMu477nJQsTBBrof5k2h --------- Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Part of #239.
Invariant
Tips
should be equal toReasons
.OpenTip.finders_fee
is true, thenOpenTip.deposit
should be greater than zero.OpenTip.reason
], implying equal length of storage.polkadot address: 12zsKEDVcHpKEWb99iFt3xrTCQQXZMu477nJQsTBBrof5k2h