referrerpolicy=no-referrer-when-downgrade

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§

source

type Currency: Currency<Self::AccountId> + ReservableCurrency<Self::AccountId>

The currency used for deposits.

source

type MaximumMembers: Get<u32>

Maximum members length allowed.

source

type Score: AtLeast32Bit + Clone + Copy + Default + FullCodec + MaybeSerializeDeserialize + Debug + TypeInfo + MaxEncodedLen

The score attributed to a member or candidate.

source

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

The overarching event type.

source

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

source

type Period: Get<BlockNumberFor<Self>>

Every Period blocks the Members are filled with the highest scoring members in the Pool.

source

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.

source

type MembershipChanged: ChangeMembers<Self::AccountId>

The receiver of the signal for when the members have changed.

source

type ScoreOrigin: EnsureOrigin<Self::RuntimeOrigin>

Allows a configurable origin type to set a score to a candidate in the pool.

source

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.

Object Safety§

This trait is not object safe.

Implementors§