Module pallet_election_provider_multi_phase::helpers[][src]

Expand description

Some helper functions/macros for this crate.

Functions

Generate a btree-map cache of the voters and their indices.

Create a function to get the stake of a voter.

Create a function that can map a target index (SolutionTargetIndexOf) to the actual target account using a linearly indexible snapshot.

Create a function that returns the index of a target in the snapshot.

Create a function that can map a voter index (SolutionVoterIndexOf) to the actual voter account using a linearly indexible snapshot.

Create a function that returns the index of a voter in the snapshot.

Create a function that returns the index of a voter in the snapshot.

Same as voter_index_fn, but the returning index is converted into usize, if possible.