Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

Commit 317d9c0

Browse files
committed
1 parent 9122cd1 commit 317d9c0

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

frame/staking/src/impls.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,10 @@ impl<T: Config> Pallet<T> {
10871087
}
10881088
}
10891089

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+
10911094
const MAXIMUM_VOTES_PER_VOTER: u32 = T::MAX_NOMINATIONS;
10921095

10931096
fn desired_targets() -> data_provider::Result<u32> {

frame/staking/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,16 @@ pub mod pallet {
351351

352352
/// Something that provides the election functionality.
353353
type ElectionProvider: ElectionProvider<
354-
Self::AccountId,
355-
Self::BlockNumber,
354+
AccountId = Self::AccountId,
355+
BlockNumber = Self::BlockNumber,
356356
// we only accept an election provider that has staking as data provider.
357357
DataProvider = Pallet<Self>,
358358
>;
359359

360360
/// Something that provides the election functionality at genesis.
361361
type GenesisElectionProvider: ElectionProvider<
362-
Self::AccountId,
363-
Self::BlockNumber,
362+
AccountId = Self::AccountId,
363+
BlockNumber = Self::BlockNumber,
364364
DataProvider = Pallet<Self>,
365365
>;
366366

frame/staking/src/substrate_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4452,7 +4452,7 @@ mod election_data_provider {
44524452
ExtBuilder::default().build_and_execute(|| {
44534453
assert_eq!(Staking::nominators(101).unwrap().targets, vec![11, 21]);
44544454
assert_eq!(
4455-
<Staking as ElectionDataProvider<AccountId, BlockNumber>>::voters(None)
4455+
<Staking as ElectionDataProvider>::voters(None)
44564456
.unwrap()
44574457
.iter()
44584458
.find(|x| x.0 == 101)
@@ -4467,7 +4467,7 @@ mod election_data_provider {
44674467
// 11 is gone.
44684468
start_active_era(2);
44694469
assert_eq!(
4470-
<Staking as ElectionDataProvider<AccountId, BlockNumber>>::voters(None)
4470+
<Staking as ElectionDataProvider>::voters(None)
44714471
.unwrap()
44724472
.iter()
44734473
.find(|x| x.0 == 101)
@@ -4479,7 +4479,7 @@ mod election_data_provider {
44794479
// resubmit and it is back
44804480
assert_ok!(Staking::nominate(Origin::signed(100), vec![11, 21]));
44814481
assert_eq!(
4482-
<Staking as ElectionDataProvider<AccountId, BlockNumber>>::voters(None)
4482+
<Staking as ElectionDataProvider>::voters(None)
44834483
.unwrap()
44844484
.iter()
44854485
.find(|x| x.0 == 101)

0 commit comments

Comments
 (0)