diff --git a/pallets/staking-rewards/src/mock.rs b/pallets/staking-rewards/src/mock.rs index 4b895470ecd..c74229d179c 100644 --- a/pallets/staking-rewards/src/mock.rs +++ b/pallets/staking-rewards/src/mock.rs @@ -19,6 +19,7 @@ use crate::{self as pallet_gear_staking_rewards, CurrencyOf}; use core::marker::PhantomData; use frame_election_provider_support::{ + bounds::{ElectionBounds, ElectionBoundsBuilder}, onchain, ElectionDataProvider, SequentialPhragmen, VoteWeight, }; use frame_support::{ @@ -233,6 +234,7 @@ parameter_types! { pub const MaxElectableTargets: u16 = 10_000; pub const MaxOnChainElectingVoters: u32 = 500; pub const MaxOnChainElectableTargets: u16 = 100; + pub static ElectionsBounds: ElectionBounds = ElectionBoundsBuilder::default().build(); } frame_election_provider_support::generate_solution_type!( @@ -252,12 +254,10 @@ impl onchain::Config for OnCha type DataProvider = pallet_staking::Pallet; type WeightInfo = (); type MaxWinners = MaxActiveValidators; - type VotersBound = MaxOnChainElectingVoters; - type TargetsBound = MaxOnChainElectableTargets; + type Bounds = ElectionBounds; } impl pallet_staking::Config for Test { - type MaxNominations = MaxNominations; type Currency = Balances; type UnixTime = Timestamp; type CurrencyBalance = ::Balance; @@ -279,6 +279,7 @@ impl pallet_staking::Config for Test { type OffendingValidatorsThreshold = OffendingValidatorsThreshold; type VoterList = BagsList; type TargetList = pallet_staking::UseValidatorsMap; + type NominationsQuota = WeightedNominationsQuota<16>; type MaxUnlockingChunks = ConstU32<32>; type HistoryDepth = HistoryDepth; type EventListeners = (); @@ -430,9 +431,8 @@ impl multi_phase::Config for Test { type Fallback = onchain::OnChainExecution>; type GovernanceFallback = onchain::OnChainExecution>; type ForceOrigin = frame_system::EnsureRoot; - type MaxElectableTargets = MaxElectableTargets; type MaxWinners = MaxActiveValidators; - type MaxElectingVoters = MaxElectingVoters; + type ElectionBounds = ElectionBounds; type WeightInfo = (); type BenchmarkingConfig = TestBenchmarkingConfig; type MinerConfig = Self;