Trait pallet_scored_pool::pallet::Config
source · pub trait Config<I: 'static = ()>: Config {
type Currency: Currency<Self::AccountId> + ReservableCurrency<Self::AccountId>;
type MaximumMembers: Get<u32>;
type Score: AtLeast32Bit + Clone + Copy + Default + FullCodec + MaybeSerializeDeserialize + Debug + TypeInfo + MaxEncodedLen;
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>;
type CandidateDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
type Period: Get<BlockNumberFor<Self>>;
type MembershipInitialized: InitializeMembers<Self::AccountId>;
type MembershipChanged: ChangeMembers<Self::AccountId>;
type ScoreOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type KickOrigin: EnsureOrigin<Self::RuntimeOrigin>;
}
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 Currency: Currency<Self::AccountId> + ReservableCurrency<Self::AccountId>
type Currency: Currency<Self::AccountId> + ReservableCurrency<Self::AccountId>
The currency used for deposits.
sourcetype MaximumMembers: Get<u32>
type MaximumMembers: Get<u32>
Maximum members length allowed.
sourcetype Score: AtLeast32Bit + Clone + Copy + Default + FullCodec + MaybeSerializeDeserialize + Debug + TypeInfo + MaxEncodedLen
type Score: AtLeast32Bit + Clone + Copy + Default + FullCodec + MaybeSerializeDeserialize + Debug + TypeInfo + MaxEncodedLen
The score attributed to a member or candidate.
sourcetype RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
type CandidateDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as Config>::AccountId>>::Balance>
sourcetype Period: Get<BlockNumberFor<Self>>
type Period: Get<BlockNumberFor<Self>>
Every Period
blocks the Members
are filled with the highest scoring
members in the Pool
.
sourcetype MembershipInitialized: InitializeMembers<Self::AccountId>
type MembershipInitialized: InitializeMembers<Self::AccountId>
The receiver of the signal for when the membership has been initialized.
This happens pre-genesis and will usually be the same as MembershipChanged
.
If you need to do something different on initialization, then you can change
this accordingly.
sourcetype MembershipChanged: ChangeMembers<Self::AccountId>
type MembershipChanged: ChangeMembers<Self::AccountId>
The receiver of the signal for when the members have changed.
sourcetype ScoreOrigin: EnsureOrigin<Self::RuntimeOrigin>
type ScoreOrigin: EnsureOrigin<Self::RuntimeOrigin>
Allows a configurable origin type to set a score to a candidate in the pool.
sourcetype KickOrigin: EnsureOrigin<Self::RuntimeOrigin>
type KickOrigin: EnsureOrigin<Self::RuntimeOrigin>
Required origin for removing a member (though can always be Root).
Configurable origin which enables removing an entity. If the entity
is part of the Members
it is immediately replaced by the next
highest scoring candidate, if available.