Function pallet_election_provider_multi_phase::helpers::voter_index_fn[][src]

pub fn voter_index_fn<T: Config>(
    cache: &BTreeMap<T::AccountId, usize>
) -> impl Fn(&T::AccountId) -> Option<SolutionVoterIndexOf<T>> + '_
Expand description

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

The returning index type is the same as the one defined in T::Solution::Voter.

Warning

Note that this will represent the snapshot data from which the cache is generated.