Staking: store last min-active-bond on-chain (#12889)

* Staking: store last min-active-bond on-chain

Storing the `min-active-bond` onchain helps the UIs with minimal on-chain costs.

Closes https://github.com/paritytech/substrate/issues/12746

* Avoid relying on  sorting to set the

* Addresses PR comments
This commit is contained in:
Gonçalo Pestana
2022-12-14 22:55:24 +00:00
committed by GitHub
parent 391adaf443
commit 14bd4bde25
3 changed files with 43 additions and 1 deletions
@@ -295,6 +295,10 @@ pub mod pallet {
#[pallet::storage]
pub type MinValidatorBond<T: Config> = StorageValue<_, BalanceOf<T>, ValueQuery>;
/// The minimum active nominator stake of the last successful election.
#[pallet::storage]
pub type MinimumActiveStake<T> = StorageValue<_, BalanceOf<T>, ValueQuery>;
/// The minimum amount of commission that validators can set.
///
/// If set to `0`, no limit exists.