pub fn voter_index_fn<T: MinerConfig>(
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.