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§
Sourcetype Sort: Get<bool>
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.
Sourcetype Solver: NposSolver<AccountId = <Self::System as Config>::AccountId, Error = Error>
type Solver: NposSolver<AccountId = <Self::System as Config>::AccountId, Error = Error>
NposSolver
that should be used, an example would be PhragMMS
.
Sourcetype MaxBackersPerWinner: Get<u32>
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.
Sourcetype MaxWinnersPerPage: Get<u32>
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.
Sourcetype DataProvider: ElectionDataProvider<AccountId = <Self::System as Config>::AccountId, BlockNumber = BlockNumberFor<Self::System>>
type DataProvider: ElectionDataProvider<AccountId = <Self::System as Config>::AccountId, BlockNumber = BlockNumberFor<Self::System>>
Something that provides the data for election.
Sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
Sourcetype Bounds: Get<ElectionBounds>
type Bounds: Get<ElectionBounds>
Elections bounds, to use when calling into Config::DataProvider
. It might be overwritten
in the InstantElectionProvider
impl.