Removes the `Default` implementation for `RewardDestination` (#2402)
This PR removes current default for `RewardDestination`, which may cause
confusion since a ledger should not have a default reward destination:
either it has a reward destination, or something is wrong. It also
changes the `Payee`'s reward destination in storage from `ValueQuery` to
`OptionQuery`.
In addition, it adds a `try_state` check to make sure each bonded ledger
have a valid reward destination.
Closes https://github.com/paritytech/polkadot-sdk/issues/2063
---------
Co-authored-by: command-bot <>
Co-authored-by:
Ross Bulat <ross@parity.io>
Showing
- substrate/frame/nomination-pools/test-staking/src/lib.rs 4 additions, 1 deletionsubstrate/frame/nomination-pools/test-staking/src/lib.rs
- substrate/frame/staking/src/benchmarking.rs 12 additions, 12 deletionssubstrate/frame/staking/src/benchmarking.rs
- substrate/frame/staking/src/ledger.rs 2 additions, 2 deletionssubstrate/frame/staking/src/ledger.rs
- substrate/frame/staking/src/lib.rs 0 additions, 6 deletionssubstrate/frame/staking/src/lib.rs
- substrate/frame/staking/src/mock.rs 12 additions, 1 deletionsubstrate/frame/staking/src/mock.rs
- substrate/frame/staking/src/pallet/impls.rs 23 additions, 7 deletionssubstrate/frame/staking/src/pallet/impls.rs
- substrate/frame/staking/src/pallet/mod.rs 3 additions, 3 deletionssubstrate/frame/staking/src/pallet/mod.rs
- substrate/frame/staking/src/tests.rs 44 additions, 21 deletionssubstrate/frame/staking/src/tests.rs
Please register or sign in to comment