Trait pallet_conviction_voting::pallet::Config

source ·
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 = BlockNumberFor<Self>> + Inspect<Self::AccountId>;
    type Polls: Polling<TallyOf<Self, I>, Votes = <<Self as Config<I>>::Currency as Currency<<Self as Config>::AccountId>>::Balance, Moment = BlockNumberFor<Self>>;
    type MaxTurnout: Get<<<Self as Config<I>>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
    type MaxVotes: Get<u32>;
    type VoteLockingPeriod: Get<BlockNumberFor<Self>>;
}
Expand description

Configuration trait of this pallet.

The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.

Consequently, a runtime that wants to include this pallet must implement this trait.

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 = BlockNumberFor<Self>> + 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 = BlockNumberFor<Self>>

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<BlockNumberFor<Self>>

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.

Object Safety§

This trait is not object safe.

Implementors§