pub trait Config {
type System: Config;
type Solver: NposSolver<AccountId = <Self::System as Config>::AccountId, Error = Error>;
type DataProvider: ElectionDataProvider<AccountId = <Self::System as Config>::AccountId, BlockNumber = <Self::System as Config>::BlockNumber>;
type WeightInfo: WeightInfo;
type MaxWinners: Get<u32>;
type VotersBound: Get<u32>;
type TargetsBound: Get<u32>;
}
Expand description
Configuration trait for an onchain election execution.
Required Associated Types§
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 DataProvider: ElectionDataProvider<AccountId = <Self::System as Config>::AccountId, BlockNumber = <Self::System as Config>::BlockNumber>
type DataProvider: ElectionDataProvider<AccountId = <Self::System as Config>::AccountId, BlockNumber = <Self::System as Config>::BlockNumber>
Something that provides the data for election.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
sourcetype MaxWinners: Get<u32>
type MaxWinners: Get<u32>
Upper bound on maximum winners from electable targets.
As noted in the documentation of ElectionProviderBase::MaxWinners
, this value should
always be more than DataProvider::desired_target
.
sourcetype VotersBound: Get<u32>
type VotersBound: Get<u32>
Bounds the number of voters, when calling into Config::DataProvider
. It might be
overwritten in the InstantElectionProvider
impl.
sourcetype TargetsBound: Get<u32>
type TargetsBound: Get<u32>
Bounds the number of targets, when calling into Config::DataProvider
. It might be
overwritten in the InstantElectionProvider
impl.