pub trait Config: Config {
type RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>;
type ValidatorId: Member + Parameter + MaybeSerializeDeserialize + MaxEncodedLen + Into<Self::AccountId>;
type ShouldEndSession: ShouldEndSession<BlockNumberFor<Self>>;
type NextSessionRotation: EstimateNextSessionRotation<BlockNumberFor<Self>>;
type SessionManager: SessionManager<Self::ValidatorId, Self::Keys>;
type SessionHandler: SessionHandler<Self::ValidatorId>;
type Keys: OpaqueKeys + Member + Parameter + MaybeSerializeDeserialize;
}
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 RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
Sourcetype ValidatorId: Member + Parameter + MaybeSerializeDeserialize + MaxEncodedLen + Into<Self::AccountId>
type ValidatorId: Member + Parameter + MaybeSerializeDeserialize + MaxEncodedLen + Into<Self::AccountId>
A stable ID for a validator.
Sourcetype ShouldEndSession: ShouldEndSession<BlockNumberFor<Self>>
type ShouldEndSession: ShouldEndSession<BlockNumberFor<Self>>
Indicator for when to end the session.
Sourcetype NextSessionRotation: EstimateNextSessionRotation<BlockNumberFor<Self>>
type NextSessionRotation: EstimateNextSessionRotation<BlockNumberFor<Self>>
Something that can predict the next session rotation. This should typically come from
the same logical unit that provides ShouldEndSession
, yet, it gives a best effort
estimate. It is helpful to implement [EstimateNextNewSession
].
Sourcetype SessionManager: SessionManager<Self::ValidatorId, Self::Keys>
type SessionManager: SessionManager<Self::ValidatorId, Self::Keys>
Handler for managing new session.
Sourcetype SessionHandler: SessionHandler<Self::ValidatorId>
type SessionHandler: SessionHandler<Self::ValidatorId>
Handler when a session has changed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.