referrerpolicy=no-referrer-when-downgrade
pub trait ElectionProvider: ElectionProviderBase {
    // Required methods
    fn ongoing() -> bool;
    fn elect() -> Result<BoundedSupportsOf<Self>, Self::Error>;
}
Expand description

Elect a new set of winners, bounded by MaxWinners.

It must always use ElectionProviderBase::DataProvider to fetch the data it needs.

This election provider that could function asynchronously. This implies that this election might needs data ahead of time (ergo, receives no arguments to elect), and might be ongoing at times.

Required Methods§

source

fn ongoing() -> bool

Indicate if this election provider is currently ongoing an asynchronous election or not.

source

fn elect() -> Result<BoundedSupportsOf<Self>, Self::Error>

Performs the election. This should be implemented as a self-weighing function. The implementor should register its appropriate weight at the end of execution with the system pallet directly.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<AccountId, BlockNumber, DataProvider, MaxWinners> ElectionProvider for NoElection<(AccountId, BlockNumber, DataProvider, MaxWinners)>
where DataProvider: ElectionDataProvider<AccountId = AccountId, BlockNumber = BlockNumber>, MaxWinners: Get<u32>,

source§

impl<T: Config> ElectionProvider for OnChainExecution<T>