move generics of election trait to associated types (#10475)

* move generics of election trait to associated types

* fix doctest
This commit is contained in:
Kian Paimani
2021-12-16 07:24:28 +01:00
committed by GitHub
parent 1b0be8ae06
commit f10203c793
9 changed files with 101 additions and 54 deletions
+3 -3
View File
@@ -4013,7 +4013,7 @@ mod election_data_provider {
ExtBuilder::default().build_and_execute(|| {
assert_eq!(Staking::nominators(101).unwrap().targets, vec![11, 21]);
assert_eq!(
<Staking as ElectionDataProvider<AccountId, BlockNumber>>::voters(None)
<Staking as ElectionDataProvider>::voters(None)
.unwrap()
.iter()
.find(|x| x.0 == 101)
@@ -4028,7 +4028,7 @@ mod election_data_provider {
// 11 is gone.
start_active_era(2);
assert_eq!(
<Staking as ElectionDataProvider<AccountId, BlockNumber>>::voters(None)
<Staking as ElectionDataProvider>::voters(None)
.unwrap()
.iter()
.find(|x| x.0 == 101)
@@ -4040,7 +4040,7 @@ mod election_data_provider {
// resubmit and it is back
assert_ok!(Staking::nominate(Origin::signed(100), vec![11, 21]));
assert_eq!(
<Staking as ElectionDataProvider<AccountId, BlockNumber>>::voters(None)
<Staking as ElectionDataProvider>::voters(None)
.unwrap()
.iter()
.find(|x| x.0 == 101)