pub trait Config: Config {
    type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
    type MaxValidators: Get<u32>;
    type AuthorityId: Member + Parameter + MaybeSerializeDeserialize + MaxEncodedLen + Ord + Into<Self::AccountId>;
    type AuthorityKeys: Parameter + Member + MaybeSerializeDeserialize + Ord + MaxEncodedLen;
    type AuthoritySelectionInputs: Parameter;
    type ScEpochNumber: Parameter + MaxEncodedLen + Zero + Display + Add + One + Default + Ord + Copy + From<u64> + Into<u64>;
    type CommitteeMember: Parameter + Member + MaybeSerializeDeserialize + MaxEncodedLen + CommitteeMember<AuthorityId = Self::AuthorityId, AuthorityKeys = Self::AuthorityKeys>;
    type MainChainScriptsOrigin: EnsureOrigin<Self::RuntimeOrigin>;
    type WeightInfo: WeightInfo;

    // Required methods
    fn select_authorities(
        input: Self::AuthoritySelectionInputs,
        sidechain_epoch: Self::ScEpochNumber,
    ) -> Option<BoundedVec<Self::CommitteeMember, Self::MaxValidators>>;
    fn current_epoch_number() -> Self::ScEpochNumber;
}
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 RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>

The ubiquitous event type.

Source

type MaxValidators: Get<u32>

Maximum amount of validators.

Source

type AuthorityId: Member + Parameter + MaybeSerializeDeserialize + MaxEncodedLen + Ord + Into<Self::AccountId>

Type identifying authorities.

Source

type AuthorityKeys: Parameter + Member + MaybeSerializeDeserialize + Ord + MaxEncodedLen

Type of authority keys.

Source

type AuthoritySelectionInputs: Parameter

Type of input data used by select_authorities to select a committee.

Source

type ScEpochNumber: Parameter + MaxEncodedLen + Zero + Display + Add + One + Default + Ord + Copy + From<u64> + Into<u64>

Type of the epoch number used by the partner chain.

Source

type CommitteeMember: Parameter + Member + MaybeSerializeDeserialize + MaxEncodedLen + CommitteeMember<AuthorityId = Self::AuthorityId, AuthorityKeys = Self::AuthorityKeys>

Type of committee members returned by select_authorities.

Source

type MainChainScriptsOrigin: EnsureOrigin<Self::RuntimeOrigin>

Origin for governance calls

Source

type WeightInfo: WeightInfo

Weight functions needed for pallet_session_validator_management.

Required Methods§

Source

fn select_authorities( input: Self::AuthoritySelectionInputs, sidechain_epoch: Self::ScEpochNumber, ) -> Option<BoundedVec<Self::CommitteeMember, Self::MaxValidators>>

Should select a committee for sidechain_epoch based on selection inputs input. Should return None if selection was impossible for the given input.

Source

fn current_epoch_number() -> Self::ScEpochNumber

Should return the current partner chain epoch.

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.

Implementors§