pub trait ElectionProviderBase {
    type AccountId;
    type BlockNumber;
    type Error: Debug;
    type MaxWinners: Get<u32>;
    type DataProvider: ElectionDataProvider<AccountId = Self::AccountId, BlockNumber = Self::BlockNumber>;

    fn desired_targets_checked() -> Result<u32> { ... }
}
Expand description

Base trait for types that can provide election

Required Associated Types§

The account identifier type.

The block number type.

The error type that is returned by the provider.

The upper bound on election winners that can be returned.

WARNING

when communicating with the data provider, one must ensure that DataProvider::desired_targets returns a value less than this bound. An implementation can chose to either return an error and/or sort and truncate the output to meet this bound.

The data provider of the election.

Provided Methods§

checked call to Self::DataProvider::desired_targets() ensuring the value never exceeds Self::MaxWinners.

Implementors§