pub trait MinerConfig {
    type AccountId: Ord + Clone + Codec + Debug;
    type Solution: Codec + Default + PartialEq + Eq + Clone + Debug + Ord + NposSolution + TypeInfo;
    type MaxVotesPerVoter;
    type MaxLength: Get<u32>;
    type MaxWeight: Get<Weight>;
    type MaxWinners: Get<u32>;

    // Required method
    fn solution_weight(
        voters: u32,
        targets: u32,
        active_voters: u32,
        degree: u32
    ) -> Weight;
}
Expand description

Configurations for a miner that comes with this pallet.

Required Associated Types§

source

type AccountId: Ord + Clone + Codec + Debug

The account id type.

source

type Solution: Codec + Default + PartialEq + Eq + Clone + Debug + Ord + NposSolution + TypeInfo

The solution that the miner is mining.

source

type MaxVotesPerVoter

Maximum number of votes per voter in the snapshots.

source

type MaxLength: Get<u32>

Maximum length of the solution that the miner is allowed to generate.

Solutions are trimmed to respect this.

source

type MaxWeight: Get<Weight>

Maximum weight of the solution that the miner is allowed to generate.

Solutions are trimmed to respect this.

The weight is computed using solution_weight.

source

type MaxWinners: Get<u32>

The maximum number of winners that can be elected.

Required Methods§

source

fn solution_weight( voters: u32, targets: u32, active_voters: u32, degree: u32 ) -> Weight

Something that can compute the weight of a solution.

This weight estimate is then used to trim the solution, based on MinerConfig::MaxWeight.

Implementors§