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§
sourcefn ongoing() -> bool
fn ongoing() -> bool
Indicate if this election provider is currently ongoing an asynchronous election or not.
sourcefn elect() -> Result<BoundedSupportsOf<Self>, Self::Error>
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.