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§
- Election
Result - Final result of the election.
- Election
Score - The score of an election. This is the main measure of an election’s quality.
- MaxFlattened
Voters - Maximum number of items that
AllVoterPagesOfcan contain, when flattened. - Paged
RawSolution - A paginated raw solution type.
Enums§
- Phase
- Current phase of the pallet.
Traits§
- Npos
Solution - An opaque index-based, NPoS solution type.
- PadSolution
Pages - 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§
- AllVoter
Pages Flattened Of - Same as
AllVoterPagesOf, but instead of being a nested bounded vec, the entire voters are flattened into one outer, unboundedVectype. - AllVoter
Pages Of - Alias for all pages of voters, parameterized by this crate’s config.
- Assignment
Of - The relative distribution of a voter’s stake among the winning targets.
- Fallback
Error Of - The fallback election type.
- Page
Index - A page index for the multi-block elections pagination.
- Solution
Accuracy Of - The accuracy of the election, when submitted from offchain. Derived from
SolutionOf. - Solution
Of - The solution type used by this crate.
- Solution
Target Index Of - The target index. Derived from
SolutionOf. - Solution
Voter Index Of - The voter index. Derived from
SolutionOf. - VoterOf
- Alias for a voter, parameterized by the miner config.
- Voter
Page Of - Alias for a page of voters, parameterized by this crate’s config.