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§
Sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
The ubiquitous event type.
Sourcetype MaxValidators: Get<u32>
type MaxValidators: Get<u32>
Maximum amount of validators.
Sourcetype AuthorityId: Member + Parameter + MaybeSerializeDeserialize + MaxEncodedLen + Ord + Into<Self::AccountId>
type AuthorityId: Member + Parameter + MaybeSerializeDeserialize + MaxEncodedLen + Ord + Into<Self::AccountId>
Type identifying authorities.
Sourcetype AuthorityKeys: Parameter + Member + MaybeSerializeDeserialize + Ord + MaxEncodedLen
type AuthorityKeys: Parameter + Member + MaybeSerializeDeserialize + Ord + MaxEncodedLen
Type of authority keys.
Sourcetype AuthoritySelectionInputs: Parameter
type AuthoritySelectionInputs: Parameter
Type of input data used by select_authorities
to select a committee.
Sourcetype ScEpochNumber: Parameter + MaxEncodedLen + Zero + Display + Add + One + Default + Ord + Copy + From<u64> + Into<u64>
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.
Sourcetype CommitteeMember: Parameter + Member + MaybeSerializeDeserialize + MaxEncodedLen + CommitteeMember<AuthorityId = Self::AuthorityId, AuthorityKeys = Self::AuthorityKeys>
type CommitteeMember: Parameter + Member + MaybeSerializeDeserialize + MaxEncodedLen + CommitteeMember<AuthorityId = Self::AuthorityId, AuthorityKeys = Self::AuthorityKeys>
Type of committee members returned by select_authorities
.
Sourcetype MainChainScriptsOrigin: EnsureOrigin<Self::RuntimeOrigin>
type MainChainScriptsOrigin: EnsureOrigin<Self::RuntimeOrigin>
Origin for governance calls
Sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight functions needed for pallet_session_validator_management.
Required Methods§
Should select a committee for sidechain_epoch
based on selection inputs input
.
Should return None if selection was impossible for the given input.
Sourcefn current_epoch_number() -> Self::ScEpochNumber
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.