Trait frame_election_provider_support::VoteWeightProvider [−][src]
pub trait VoteWeightProvider<AccountId> {
fn vote_weight(who: &AccountId) -> VoteWeight;
fn set_vote_weight_of(_: &AccountId, _: VoteWeight) { ... }
}
Expand description
Something that can provide the VoteWeight
of an account. Similar to ElectionProvider
and
ElectionDataProvider
, this should typically be implementing by whoever is supposed to use
SortedListProvider
.
Required methods
fn vote_weight(who: &AccountId) -> VoteWeight
fn vote_weight(who: &AccountId) -> VoteWeight
Get the current VoteWeight
of who
.
Provided methods
fn set_vote_weight_of(_: &AccountId, _: VoteWeight)
fn set_vote_weight_of(_: &AccountId, _: VoteWeight)
For tests and benchmarks, set the VoteWeight
.