diff --git a/src/frame/staking.rs b/src/frame/staking.rs index d4a6c7b469..b08d5940e0 100644 --- a/src/frame/staking.rs +++ b/src/frame/staking.rs @@ -47,20 +47,6 @@ pub use pallet_staking::{ ValidatorPrefs, }; -/// Similar to `ErasStakers`, this holds the preferences of validators. -/// -/// This is keyed first by the era index to allow bulk deletion and then the stash account. -/// -/// It is removed after `HISTORY_DEPTH` eras. -#[derive(Encode, Decode, Debug, Store)] -pub struct ErasValidatorPrefsStore { - #[store(returns = ValidatorPrefs)] - /// Era index - pub index: EraIndex, - /// Account ID - pub account_id: T::AccountId, -} - /// Rewards for the last `HISTORY_DEPTH` eras. /// If reward hasn't been set or has been removed then 0 reward is returned. #[derive(Clone, Encode, Decode, Debug, Store)] @@ -103,23 +89,6 @@ pub trait Staking: Balances { + Copy + MaybeSerialize + Debug; - - /// Maximum number of validators that can be stored in a snapshot. - const MAX_VALIDATORS: usize; - - /// Maximum number of nominators that can be stored in a snapshot. - const MAX_NOMINATORS: usize; -} - -/// A Balance/BlockNumber tuple to encode when a chunk of funds will be unlocked. -#[derive(Clone, Encode, Decode, Debug)] -pub struct UnlockChunk { - /// Amount of funds to be unlocked. - #[codec(compact)] - pub value: T::Balance, - /// Era number at which point the funds will be unlocked. - #[codec(compact)] - pub era: EraIndex, } /// Number of eras to keep in history. @@ -136,34 +105,6 @@ pub struct HistoryDepthStore { pub _runtime: PhantomData, } -/// The ideal number of staking participants. -#[derive(Encode, Decode, Copy, Clone, Debug, Store)] -pub struct ValidatorCountStore { - #[store(returns = u32)] - /// Marker for the runtime - pub _runtime: PhantomData, -} - -/// Minimum number of staking participants before emergency conditions are imposed. -#[derive( - Encode, Decode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store, -)] -pub struct MinimumValidatorCountStore { - #[store(returns = u32)] - /// Marker for the runtime - pub _runtime: PhantomData, -} - -/// Any validators that may never be slashed or forcibly kicked. It's a Vec since they're -/// easy to initialize and the performance hit is minimal (we expect no more than four -/// invulnerables) and restricted to testnets. -#[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] -pub struct InvulnerablesStore { - #[store(returns = Vec)] - /// Marker for the runtime - pub _runtime: PhantomData, -} - /// Map from all locked "stash" accounts to the controller account. #[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] pub struct BondedStore { diff --git a/src/runtimes.rs b/src/runtimes.rs index b38bee0dbe..f86096e0d5 100644 --- a/src/runtimes.rs +++ b/src/runtimes.rs @@ -149,8 +149,6 @@ pub struct DefaultNodeRuntime; impl Staking for DefaultNodeRuntime { type NominatorIndex = u32; type ValidatorIndex = u16; - const MAX_VALIDATORS: usize = Self::ValidatorIndex::max_value() as usize; - const MAX_NOMINATORS: usize = Self::NominatorIndex::max_value() as usize; } impl Runtime for DefaultNodeRuntime { @@ -257,8 +255,6 @@ impl Session for KusamaRuntime { impl Staking for KusamaRuntime { type NominatorIndex = u32; type ValidatorIndex = u16; - const MAX_VALIDATORS: usize = Self::ValidatorIndex::max_value() as usize; - const MAX_NOMINATORS: usize = Self::NominatorIndex::max_value() as usize; } impl Balances for KusamaRuntime {