This repository was archived by the owner on Mar 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -1087,7 +1087,10 @@ impl<T: Config> Pallet<T> {
1087
1087
}
1088
1088
}
1089
1089
1090
- impl < T : Config > ElectionDataProvider < AccountId < T > , BlockNumberFor < T > > for Pallet < T > {
1090
+ impl < T : Config > ElectionDataProvider for Pallet < T > {
1091
+ type AccountId = AccountId < T > ;
1092
+ type BlockNumber = BlockNumberFor < T > ;
1093
+
1091
1094
const MAXIMUM_VOTES_PER_VOTER : u32 = T :: MAX_NOMINATIONS ;
1092
1095
1093
1096
fn desired_targets ( ) -> data_provider:: Result < u32 > {
Original file line number Diff line number Diff line change @@ -351,16 +351,16 @@ pub mod pallet {
351
351
352
352
/// Something that provides the election functionality.
353
353
type ElectionProvider : ElectionProvider <
354
- Self :: AccountId ,
355
- Self :: BlockNumber ,
354
+ AccountId = Self :: AccountId ,
355
+ BlockNumber = Self :: BlockNumber ,
356
356
// we only accept an election provider that has staking as data provider.
357
357
DataProvider = Pallet < Self > ,
358
358
> ;
359
359
360
360
/// Something that provides the election functionality at genesis.
361
361
type GenesisElectionProvider : ElectionProvider <
362
- Self :: AccountId ,
363
- Self :: BlockNumber ,
362
+ AccountId = Self :: AccountId ,
363
+ BlockNumber = Self :: BlockNumber ,
364
364
DataProvider = Pallet < Self > ,
365
365
> ;
366
366
Original file line number Diff line number Diff line change @@ -4452,7 +4452,7 @@ mod election_data_provider {
4452
4452
ExtBuilder :: default ( ) . build_and_execute ( || {
4453
4453
assert_eq ! ( Staking :: nominators( 101 ) . unwrap( ) . targets, vec![ 11 , 21 ] ) ;
4454
4454
assert_eq ! (
4455
- <Staking as ElectionDataProvider < AccountId , BlockNumber > >:: voters( None )
4455
+ <Staking as ElectionDataProvider >:: voters( None )
4456
4456
. unwrap( )
4457
4457
. iter( )
4458
4458
. find( |x| x. 0 == 101 )
@@ -4467,7 +4467,7 @@ mod election_data_provider {
4467
4467
// 11 is gone.
4468
4468
start_active_era ( 2 ) ;
4469
4469
assert_eq ! (
4470
- <Staking as ElectionDataProvider < AccountId , BlockNumber > >:: voters( None )
4470
+ <Staking as ElectionDataProvider >:: voters( None )
4471
4471
. unwrap( )
4472
4472
. iter( )
4473
4473
. find( |x| x. 0 == 101 )
@@ -4479,7 +4479,7 @@ mod election_data_provider {
4479
4479
// resubmit and it is back
4480
4480
assert_ok ! ( Staking :: nominate( Origin :: signed( 100 ) , vec![ 11 , 21 ] ) ) ;
4481
4481
assert_eq ! (
4482
- <Staking as ElectionDataProvider < AccountId , BlockNumber > >:: voters( None )
4482
+ <Staking as ElectionDataProvider >:: voters( None )
4483
4483
. unwrap( )
4484
4484
. iter( )
4485
4485
. find( |x| x. 0 == 101 )
You can’t perform that action at this time.
0 commit comments