Adding try_state hook for Tips pallet (#1871)

Part of https://github.com/paritytech/polkadot-sdk/issues/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>
This commit is contained in:
Doordashcon
2024-01-20 10:51:25 +01:00
committed by GitHub
parent 84ff0a974d
commit 3b7a8c75bb
3 changed files with 178 additions and 15 deletions
+12
View File
@@ -0,0 +1,12 @@
title: Adding `try-state` hook to tips pallet
doc:
- audience: Runtime User
description: |
Enforces the following invariants;
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.
crates:
- name: pallet-tips