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§
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
sourcetype RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
The runtime event type.
sourcetype RemoveOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>
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.
sourcetype PromoteOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>
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.
sourcetype DemoteOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>
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.
sourcetype ExchangeOrigin: EnsureOrigin<Self::RuntimeOrigin>
type ExchangeOrigin: EnsureOrigin<Self::RuntimeOrigin>
The origin that can swap the account of a member.
sourcetype Polls: Polling<TallyOf<Self, I>, Votes = Votes, Moment = BlockNumberFor<Self>>
type Polls: Polling<TallyOf<Self, I>, Votes = Votes, Moment = BlockNumberFor<Self>>
The polling system used for our voting.
sourcetype MinRankOfClass: Convert<ClassOf<Self, I>, Rank>
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”.
sourcetype MemberSwappedHandler: RankedMembersSwapHandler<<Pallet<Self, I> as RankedMembers>::AccountId, <Pallet<Self, I> as RankedMembers>::Rank>
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.
sourcetype VoteWeight: Convert<Rank, Votes>
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.
sourcetype MaxMemberCount: MaybeConvert<Rank, MemberIndex>
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.
sourcetype BenchmarkSetup: BenchmarkSetup<Self::AccountId>
type BenchmarkSetup: BenchmarkSetup<Self::AccountId>
Setup a member for benchmarking.