referrerpolicy=no-referrer-when-downgrade
Expand description

Common types of the pallet Common types and traits of the EPMB pallet group.

§SolutionOf

This type is among the most cryptic used in the EPMB pallet. The origins of this type go back to the fact that sending a solution, with hundreds or thousands of account-ids in it would be too large for a chain to handle. This was particularly the case in a single page solution, as developed in election-provider-multi-phase. To combat this, a “compact” custom type is generated to encapsulate a solution. This type is generated by [frame_election_provider_support::generate_solution_type]. See the documentation of this macro for more information about the hacks used to reduce the size of the solution.

Consequently, the SolutionVoterIndexOf and SolutionTargetIndexOf and SolutionAccuracyOf are derived from this type.

§Phase

This is the most important type of this pallet, demonstrating the state-machine used to manage the election process and its various phases.

Structs§

ElectionResult
Final result of the election.
ElectionScore
The score of an election. This is the main measure of an election’s quality.
MaxFlattenedVoters
Maximum number of items that AllVoterPagesOf can contain, when flattened.
PagedRawSolution
A paginated raw solution type.

Enums§

Phase
Current phase of the pallet.

Traits§

NposSolution
An opaque index-based, NPoS solution type.
PadSolutionPages
Helper trait to pad a partial solution such that the leftover pages are filled with zero.
Pagify
A helper trait to deal with the page index of partial solutions.

Type Aliases§

AllVoterPagesFlattenedOf
Same as AllVoterPagesOf, but instead of being a nested bounded vec, the entire voters are flattened into one outer, unbounded Vec type.
AllVoterPagesOf
Alias for all pages of voters, parameterized by this crate’s config.
AssignmentOf
The relative distribution of a voter’s stake among the winning targets.
FallbackErrorOf
The fallback election type.
PageIndex
A page index for the multi-block elections pagination.
SolutionAccuracyOf
The accuracy of the election, when submitted from offchain. Derived from SolutionOf.
SolutionOf
The solution type used by this crate.
SolutionTargetIndexOf
The target index. Derived from SolutionOf.
SolutionVoterIndexOf
The voter index. Derived from SolutionOf.
VoterOf
Alias for a voter, parameterized by the miner config.
VoterPageOf
Alias for a page of voters, parameterized by this crate’s config.