referrerpolicy=no-referrer-when-downgrade

Trait pallet_ranked_collective::pallet::Config

source ·
pub trait Config<I: 'static = ()>: Config {
Show 13 associated items type WeightInfo: WeightInfo; type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>; type AddOrigin: EnsureOrigin<Self::RuntimeOrigin>; type RemoveOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>; type PromoteOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>; type DemoteOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>; type ExchangeOrigin: EnsureOrigin<Self::RuntimeOrigin>; type Polls: Polling<TallyOf<Self, I>, Votes = Votes, Moment = BlockNumberFor<Self>>; type MinRankOfClass: Convert<ClassOf<Self, I>, Rank>; type MemberSwappedHandler: RankedMembersSwapHandler<<Pallet<Self, I> as RankedMembers>::AccountId, <Pallet<Self, I> as RankedMembers>::Rank>; type VoteWeight: Convert<Rank, Votes>; type MaxMemberCount: MaybeConvert<Rank, MemberIndex>; type BenchmarkSetup: BenchmarkSetup<Self::AccountId>;
}
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 WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

source

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

The runtime event type.

source

type AddOrigin: EnsureOrigin<Self::RuntimeOrigin>

The origin required to add a member.

source

type RemoveOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>

The origin required to remove a member.

The success value indicates the maximum rank from which the removal may be.

source

type PromoteOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>

The origin required to promote a member. The success value indicates the maximum rank to which the promotion may be.

source

type DemoteOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>

The origin required to demote a member. The success value indicates the maximum rank from which the demotion may be.

source

type ExchangeOrigin: EnsureOrigin<Self::RuntimeOrigin>

The origin that can swap the account of a member.

source

type Polls: Polling<TallyOf<Self, I>, Votes = Votes, Moment = BlockNumberFor<Self>>

The polling system used for our voting.

source

type MinRankOfClass: Convert<ClassOf<Self, I>, Rank>

Convert the tally class into the minimum rank required to vote on the poll. If Polls::Class is the same type as Rank, then Identity can be used here to mean “a rank of at least the poll class”.

source

type MemberSwappedHandler: RankedMembersSwapHandler<<Pallet<Self, I> as RankedMembers>::AccountId, <Pallet<Self, I> as RankedMembers>::Rank>

An external handler that will be notified when two members are swapped.

source

type VoteWeight: Convert<Rank, Votes>

Convert a rank_delta into a number of votes the rank gets.

Rank_delta is defined as the number of ranks above the minimum required to take part in the poll.

source

type MaxMemberCount: MaybeConvert<Rank, MemberIndex>

The maximum number of members for a given rank in the collective.

The member at rank x contributes to the count at rank x and all ranks below it. Therefore, the limit m at rank x sets the maximum total member count for rank x and all ranks above. The None indicates no member count limit for the given rank.

source

type BenchmarkSetup: BenchmarkSetup<Self::AccountId>

Setup a member for benchmarking.

Object Safety§

This trait is not object safe.

Implementors§