referrerpolicy=no-referrer-when-downgrade

Module helpers

Source
Expand description

Some helper functions/macros for this crate.

Functions§

generate_voter_cache
Generate a btree-map cache of the voters and their indices.
stake_of_fn
Create a function to get the stake of a voter.
target_at_fn
Create a function that can map a target index (SolutionTargetIndexOf) to the actual target account using a linearly indexable snapshot.
target_index_fn
Create a function that returns the index of a target in the snapshot.
voter_at_fn
Create a function that can map a voter index (SolutionVoterIndexOf) to the actual voter account using a linearly indexable snapshot.
voter_index_fn
Create a function that returns the index of a voter in the snapshot.
voter_index_fn_owned
Create a function that returns the index of a voter in the snapshot.
voter_index_fn_usize
Same as voter_index_fn, but the returning index is converted into usize, if possible.