From 49b3b1e82099f122a07be66b40764dab85605ccb Mon Sep 17 00:00:00 2001 From: "Demi M. Obenour" Date: Sun, 31 May 2020 16:57:39 -0400 Subject: [PATCH] Use the correct key for staking maps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They use the key type, not ‘PhantomData’. --- src/frame/staking.rs | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/frame/staking.rs b/src/frame/staking.rs index 97c79fc4c6..3fad2a0e2e 100644 --- a/src/frame/staking.rs +++ b/src/frame/staking.rs @@ -194,40 +194,40 @@ pub struct InvulnerablesStore { #[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] pub struct BondedStore { #[store(returns = Vec)] - /// Marker for the runtime - pub _runtime: PhantomData, + /// Tٗhe stash account + pub stash: T::AccountId, } /// Map from all (unlocked) "controller" accounts to the info regarding the staking. #[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] pub struct LedgerStore { #[store(returns = Option>)] - /// Marker for the runtime - pub _runtime: PhantomData, + /// The controller account + pub controller: T::AccountId, } /// Where the reward payment should be made. Keyed by stash. #[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] pub struct PayeeStore { #[store(returns = RewardDestination)] - /// Marker for the runtime - pub _runtime: PhantomData, + /// Tٗhe stash account + pub stash: T::AccountId, } /// The map from (wannabe) validator stash key to the preferences of that validator. #[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] pub struct ValidatorsStore { #[store(returns = ValidatorPrefs)] - /// Marker for the runtime - pub _runtime: PhantomData, + /// Tٗhe stash account + pub stash: T::AccountId, } /// The map from nominator stash key to the set of stash keys of all validators to nominate. #[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] pub struct NominatorsStore { #[store(returns = Option>)] - /// Marker for the runtime - pub _runtime: PhantomData, + /// Tٗhe stash account + pub stash: T::AccountId, } /// The current era index. @@ -237,10 +237,7 @@ pub struct NominatorsStore { #[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] pub struct CurrentEraStore { #[store(returns = Option)] - /// The current era index. - /// - /// This is the latest planned era, depending on how the Session pallet queues the validator - /// set, it might be active or not. + /// Marker for the runtime pub _runtime: PhantomData, } @@ -306,7 +303,7 @@ pub struct NominateCall { } /// Claim a payout. -#[derive(PartialEq, Eq, Clone, Call, Encode)] +#[derive(PartialEq, Eq, Clone, Call, Encode, Decode)] struct PayoutStakersCall<'a, T: System> { pub validator_stash: &'a T::AccountId, pub era: EraIndex,