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 authored and GitHub committed 2021-12-16 06:24:28 +00:00
1 parent 1b0be8ae06
commit f10203c793
9 files changed
+101 -54

No files matched your search

@@ -285,7 +285,9 @@ impl onchain::Config for Runtime {
}
pub struct MockFallback;
impl ElectionProvider<AccountId, u64> for MockFallback {
impl ElectionProvider for MockFallback {
type AccountId = AccountId;
type BlockNumber = u64;
type Error = &'static str;
type DataProvider = StakingMock;
@@ -438,7 +440,9 @@ pub type Extrinsic = sp_runtime::testing::TestXt<Call, ()>;
pub struct ExtBuilder {}
pub struct StakingMock;
impl ElectionDataProvider<AccountId, u64> for StakingMock {
impl ElectionDataProvider for StakingMock {
type AccountId = AccountId;
type BlockNumber = u64;
const MAXIMUM_VOTES_PER_VOTER: u32 = <TestNposSolution as NposSolution>::LIMIT as u32;
fn targets(maybe_max_len: Option<usize>) -> data_provider::Result<Vec<AccountId>> {
let targets = Targets::get();