@@ -19,7 +19,7 @@ use crate::shared;
1919use frame:: testing_prelude:: * ;
2020use frame_election_provider_support:: {
2121 bounds:: { ElectionBounds , ElectionBoundsBuilder } ,
22- SequentialPhragmen , VoteWeight ,
22+ SequentialPhragmen ,
2323} ;
2424use frame_support:: {
2525 sp_runtime:: testing:: TestXt ,
@@ -54,8 +54,6 @@ construct_runtime! {
5454 MultiBlockVerifier : multi_block:: verifier,
5555 MultiBlockSigned : multi_block:: signed,
5656 MultiBlockUnsigned : multi_block:: unsigned,
57-
58- VoterBagsList : pallet_bags_list:: <Instance1 >,
5957 Dap : pallet_dap,
6058 }
6159}
@@ -85,7 +83,6 @@ pub fn roll_next() {
8583 let mut meter = NextPollWeight :: take ( )
8684 . map ( WeightMeter :: with_limit)
8785 . unwrap_or_else ( System :: remaining_block_weight) ;
88- VoterBagsList :: on_idle ( next, meter. limit ( ) ) ;
8986 Staking :: on_poll ( next, & mut meter) ;
9087 MultiBlock :: on_poll ( next, & mut meter) ;
9188}
@@ -280,24 +277,6 @@ pub type Hash = <Runtime as frame_system::Config>::Hash;
280277pub type BlockNumber = BlockNumberFor < Runtime > ;
281278pub type BlockWeights = <Runtime as frame_system:: Config >:: BlockWeights ;
282279
283- pub ( crate ) const THRESHOLDS : [ VoteWeight ; 9 ] = [ 10 , 20 , 30 , 40 , 50 , 60 , 1_000 , 2_000 , 10_000 ] ;
284-
285- parameter_types ! {
286- pub static BagThresholds : & ' static [ VoteWeight ] = & THRESHOLDS ;
287- pub static MaxAutoRebagPerBlock : u32 = 10 ;
288- }
289-
290- pub type VoterBagsListInstance = pallet_bags_list:: Instance1 ;
291- impl pallet_bags_list:: Config < VoterBagsListInstance > for Runtime {
292- type RuntimeEvent = RuntimeEvent ;
293- type WeightInfo = ( ) ;
294- // Staking is the source of truth for voter bags list, since they are not kept up to date.
295- type ScoreProvider = Staking ;
296- type BagThresholds = BagThresholds ;
297- type MaxAutoRebagPerBlock = MaxAutoRebagPerBlock ;
298- type Score = VoteWeight ;
299- }
300-
301280#[ derive_impl( frame_system:: config_preludes:: TestDefaultConfig ) ]
302281impl frame_system:: Config for Runtime {
303282 type Block = MockBlock < Self > ;
@@ -491,7 +470,7 @@ impl pallet_staking_async::Config for Runtime {
491470 type MaxUnlockingChunks = ConstU32 < 16 > ;
492471 type NominationsQuota = pallet_staking_async:: FixedNominationsQuota < 16 > ;
493472
494- type VoterList = VoterBagsList ;
473+ type VoterList = pallet_staking_async :: UseNominatorsAndValidatorsMap < Self > ;
495474 type TargetList = pallet_staking_async:: UseValidatorsMap < Self > ;
496475
497476 type RcClientInterface = RcClient ;
0 commit comments