pub trait NominationsQuota<Balance> {
    type MaxNominations: Get<u32>;

    // Required method
    fn curve(balance: Balance) -> u32;

    // Provided method
    fn get_quota(balance: Balance) -> u32 { ... }
}
Expand description

Something that defines the maximum number of nominations per nominator based on a curve.

The method curve implements the nomination quota curve and should not be used directly. However, get_quota returns the bounded maximum number of nominations based on fn curve and the nominator’s balance.

Required Associated Types§

source

type MaxNominations: Get<u32>

Strict maximum number of nominations that caps the nominations curve. This value can be used as the upper bound of the number of votes per nominator.

Required Methods§

source

fn curve(balance: Balance) -> u32

Returns the voter’s nomination quota based on its balance and a curve.

Provided Methods§

source

fn get_quota(balance: Balance) -> u32

Returns the voter’s nomination quota within reasonable bounds [min, max], where min is 1 and max is Self::MaxNominations.

Implementors§

source§

impl<Balance, const MAX: u32> NominationsQuota<Balance> for FixedNominationsQuota<MAX>

§

type MaxNominations = ConstU32<MAX>