Adding try_state hook for Tips pallet #1871
Conversation
ggwpez
left a comment
There was a problem hiding this comment.
(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
gpestana
left a comment
There was a problem hiding this comment.
Added a couple of comments, but approving. thanks!
Co-authored-by: Gonçalo Pestana <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
ggwpez
left a comment
There was a problem hiding this comment.
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 <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Part of #239.
Invariant
Tipsshould be equal toReasons.OpenTip.finders_feeis true, thenOpenTip.depositshould be greater than zero.OpenTip.reason], implying equal length of storage.polkadot address: 12zsKEDVcHpKEWb99iFt3xrTCQQXZMu477nJQsTBBrof5k2h