Frame: `Consideration` trait generic over `Footprint` and indicates zero cost (#4596)
`Consideration` trait generic over `Footprint` and indicates zero cost for a give footprint. `Consideration` trait is generic over `Footprint` (currently defined over the type with the same name). This makes it possible to setup a custom footprint (e.g. current number of proposals in the storage). `Consideration::new` and `Consideration::update` return an `Option<Self>` instead `Self`, this make it possible to indicate a no cost for a specific footprint (e.g. if current number of proposals in the storage < max_proposal_count / 2 then no cost). These cases need to be handled for https://github.com/paritytech/polkadot-sdk/pull/3151
Showing
- prdoc/pr_4596.prdoc 18 additions, 0 deletionsprdoc/pr_4596.prdoc
- substrate/frame/balances/src/tests/fungible_tests.rs 171 additions, 6 deletionssubstrate/frame/balances/src/tests/fungible_tests.rs
- substrate/frame/balances/src/tests/mod.rs 4 additions, 0 deletionssubstrate/frame/balances/src/tests/mod.rs
- substrate/frame/preimage/src/benchmarking.rs 1 addition, 1 deletionsubstrate/frame/preimage/src/benchmarking.rs
- substrate/frame/preimage/src/lib.rs 11 additions, 8 deletionssubstrate/frame/preimage/src/lib.rs
- substrate/frame/support/src/traits/storage.rs 15 additions, 11 deletionssubstrate/frame/support/src/traits/storage.rs
- substrate/frame/support/src/traits/tokens/fungible/mod.rs 79 additions, 34 deletionssubstrate/frame/support/src/traits/tokens/fungible/mod.rs
Please register or sign in to comment