referrerpolicy=no-referrer-when-downgrade
pub trait Config {
    type Sort: Get<bool>;
    type System: Config;
    type Solver: NposSolver<AccountId = <Self::System as Config>::AccountId, Error = Error>;
    type MaxBackersPerWinner: Get<u32>;
    type MaxWinnersPerPage: Get<u32>;
    type DataProvider: ElectionDataProvider<AccountId = <Self::System as Config>::AccountId, BlockNumber = BlockNumberFor<Self::System>>;
    type WeightInfo: WeightInfo;
    type Bounds: Get<ElectionBounds>;
}
Expand description

Configuration trait for an onchain election execution.

Required Associated Types§

Source

type Sort: Get<bool>

Whether to try and sort or not.

If true, the supports will be sorted by descending total support to meet the bounds. If false, FailedToBound error may be returned.

Source

type System: Config

Needed for weight registration.

Source

type Solver: NposSolver<AccountId = <Self::System as Config>::AccountId, Error = Error>

NposSolver that should be used, an example would be PhragMMS.

Source

type MaxBackersPerWinner: Get<u32>

Maximum number of backers allowed per target.

If the bounds are exceeded due to the data returned by the data provider, the election will fail.

Source

type MaxWinnersPerPage: Get<u32>

Maximum number of winners in an election.

If the bounds are exceeded due to the data returned by the data provider, the election will fail.

Source

type DataProvider: ElectionDataProvider<AccountId = <Self::System as Config>::AccountId, BlockNumber = BlockNumberFor<Self::System>>

Something that provides the data for election.

Source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

Source

type Bounds: Get<ElectionBounds>

Elections bounds, to use when calling into Config::DataProvider. It might be overwritten in the InstantElectionProvider impl.

Implementors§