Trait pallet_elections::pallet::Config [−][src]
pub trait Config: Config {}Show associated items
type Event: From<Event<Self>> + IsType<<Self as Config>::Event>; type PalletId: Get<LockIdentifier>; type Currency: LockableCurrency<Self::AccountId, Moment = Self::BlockNumber> + ReservableCurrency<Self::AccountId>; type BadPresentation: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>; type BadReaper: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>; type BadVoterIndex: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>; type LoserCandidate: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>; type ChangeMembers: ChangeMembers<Self::AccountId>; type CandidacyBond: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>; type VotingBond: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>; type VotingFee: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>; type MinimumVotingLock: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>; type PresentSlashPerVoter: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>; type CarryCount: Get<u32>; type InactiveGracePeriod: Get<VoteIndex>; type VotingPeriod: Get<Self::BlockNumber>; type DecayRatio: Get<u32>;
Expand description
Configuration trait of this pallet.
Implement this type for a runtime in order to customize this pallet.
Associated Types
type PalletId: Get<LockIdentifier>
type PalletId: Get<LockIdentifier>
Identifier for the elections pallet’s lock
type Currency: LockableCurrency<Self::AccountId, Moment = Self::BlockNumber> + ReservableCurrency<Self::AccountId>
type Currency: LockableCurrency<Self::AccountId, Moment = Self::BlockNumber> + ReservableCurrency<Self::AccountId>
The currency that people are electing with.
type BadPresentation: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
type BadPresentation: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
Handler for the unbalanced reduction when slashing a validator.
type BadReaper: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
type BadReaper: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
Handler for the unbalanced reduction when slashing an invalid reaping attempt.
type BadVoterIndex: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
type BadVoterIndex: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
Handler for the unbalanced reduction when submitting a bad voter_index
.
type LoserCandidate: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
type LoserCandidate: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
Handler for the unbalanced reduction when a candidate has lost (and is not a runner up)
type ChangeMembers: ChangeMembers<Self::AccountId>
type ChangeMembers: ChangeMembers<Self::AccountId>
What to do when the members change.
How much should be locked up in order to submit one’s candidacy. A reasonable default value is 9.
How much should be locked up in order to be able to submit votes.
The amount of fee paid upon each vote submission, unless if they submit a hole index and replace it.
Minimum about that can be used as the locked value for voting.
The punishment, per voter, if you provide an invalid presentation. A reasonable default value is 1.
type CarryCount: Get<u32>
type CarryCount: Get<u32>
How many runners-up should have their approvals persist until the next vote. A reasonable default value is 2.
type InactiveGracePeriod: Get<VoteIndex>
type InactiveGracePeriod: Get<VoteIndex>
How many vote indices need to go by after a target voter’s last vote before they can be reaped if their approvals are moot. A reasonable default value is 1.
type VotingPeriod: Get<Self::BlockNumber>
type VotingPeriod: Get<Self::BlockNumber>
How often (in blocks) to check for new votes. A reasonable default value is 1000.
type DecayRatio: Get<u32>
type DecayRatio: Get<u32>
Decay factor of weight when being accumulated. It should typically be set to
at least membership_size -1
to keep the collective secure.
When set to N
, it indicates (1/N)^t
of staked is decayed at weight
increment step t
. 0 will result in no weight being added at all (normal
approval voting). A reasonable default value is 24.