Trait tp_election_providers::ElectionDataProvider[][src]

pub trait ElectionDataProvider<AccountId, BlockNumber> {
    fn targets() -> Vec<AccountId>;
fn voters() -> Vec<(AccountId, VoteWeight, Vec<AccountId>)>;
fn desired_targets() -> u32;
fn next_election_prediction(now: BlockNumber) -> BlockNumber; }

Something that can provide the data to an ElectionProvider.

Required methods

fn targets() -> Vec<AccountId>[src]

All possible targets for the election, i.e. the candidates.

fn voters() -> Vec<(AccountId, VoteWeight, Vec<AccountId>)>[src]

All possible voters for the election.

Note that if a notion of self-vote exists, it should be represented here.

fn desired_targets() -> u32[src]

The number of targets to elect.

fn next_election_prediction(now: BlockNumber) -> BlockNumber[src]

Provide a best effort prediction about when the next election is about to happen.

In essence, the implementor should predict with this function when it will trigger the ElectionProvider::elect.

This is only useful for stateful election providers.

Loading content...

Implementations on Foreign Types

impl<AccountId, BlockNumber> ElectionDataProvider<AccountId, BlockNumber> for ()[src]

Loading content...

Implementors

Loading content...