pub trait Config<I: 'static = ()>: Config + Sized {
    type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>;
    type WeightInfo: WeightInfo;
    type Currency: ReservableCurrency<Self::AccountId> + LockableCurrency<Self::AccountId, Moment = Self::BlockNumber> + Inspect<Self::AccountId>;
    type Polls: Polling<TallyOf<Self, I>, Votes = <<Self as Config<I>>::Currency as Currency<<Self as Config>::AccountId>>::Balance, Moment = Self::BlockNumber>;
    type MaxTurnout: Get<<<Self as Config<I>>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
    type MaxVotes: Get<u32>;
    type VoteLockingPeriod: Get<Self::BlockNumber>;
}
Expand description

Configuration trait of this pallet.

Implement this type for a runtime in order to customize this pallet.

Required Associated Types§

source

type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>

source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

source

type Currency: ReservableCurrency<Self::AccountId> + LockableCurrency<Self::AccountId, Moment = Self::BlockNumber> + Inspect<Self::AccountId>

Currency type with which voting happens.

source

type Polls: Polling<TallyOf<Self, I>, Votes = <<Self as Config<I>>::Currency as Currency<<Self as Config>::AccountId>>::Balance, Moment = Self::BlockNumber>

The implementation of the logic which conducts polls.

source

type MaxTurnout: Get<<<Self as Config<I>>::Currency as Currency<<Self as Config>::AccountId>>::Balance>

The maximum amount of tokens which may be used for voting. May just be Currency::total_issuance, but you might want to reduce this in order to account for funds in the system which are unable to vote (e.g. parachain auction deposits).

source

type MaxVotes: Get<u32>

The maximum number of concurrent votes an account may have.

Also used to compute weight, an overly large value can lead to extrinsics with large weight estimation: see delegate for instance.

source

type VoteLockingPeriod: Get<Self::BlockNumber>

The minimum period of vote locking.

It should be no shorter than enactment period to ensure that in the case of an approval, those successful voters are locked into the consequences that their votes entail.

Implementors§