Struct pallet_authority_members::pallet::Pallet
source · pub struct Pallet<T>(PhantomData<T>);
Expand description
The Pallet
struct, the main type that implements traits and standalone
functions within the pallet.
Tuple Fields§
§0: PhantomData<T>
Implementations§
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn go_offline(origin: OriginFor<T>) -> DispatchResultWithPostInfo
pub fn go_offline(origin: OriginFor<T>) -> DispatchResultWithPostInfo
Request to leave the set of validators two sessions later.
sourcepub fn go_online(origin: OriginFor<T>) -> DispatchResultWithPostInfo
pub fn go_online(origin: OriginFor<T>) -> DispatchResultWithPostInfo
Request to join the set of validators two sessions later.
sourcepub fn set_session_keys(
origin: OriginFor<T>,
keys: T::Keys
) -> DispatchResultWithPostInfo
pub fn set_session_keys( origin: OriginFor<T>, keys: T::Keys ) -> DispatchResultWithPostInfo
Declare new session keys to replace current ones.
sourcepub fn remove_member(
origin: OriginFor<T>,
member_id: T::MemberId
) -> DispatchResultWithPostInfo
pub fn remove_member( origin: OriginFor<T>, member_id: T::MemberId ) -> DispatchResultWithPostInfo
Remove a member from the set of validators.
sourcepub fn remove_member_from_blacklist(
origin: OriginFor<T>,
member_id: T::MemberId
) -> DispatchResultWithPostInfo
pub fn remove_member_from_blacklist( origin: OriginFor<T>, member_id: T::MemberId ) -> DispatchResultWithPostInfo
Remove a member from the blacklist. remove an identity from the blacklist
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn change_owner_key(
member_id: T::MemberId,
new_owner_key: T::AccountId
) -> DispatchResultWithPostInfo
pub fn change_owner_key( member_id: T::MemberId, new_owner_key: T::AccountId ) -> DispatchResultWithPostInfo
Change the owner key of an authority member.
Get the number of authorities.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcefn do_remove_member(member_id: T::MemberId, owner_key: T::AccountId)
fn do_remove_member(member_id: T::MemberId, owner_key: T::AccountId)
Perform authority member removal.
sourcepub fn insert_out(member_id: T::MemberId) -> bool
pub fn insert_out(member_id: T::MemberId) -> bool
Perform outgoing authority insertion.
sourcefn is_incoming(member_id: T::MemberId) -> bool
fn is_incoming(member_id: T::MemberId) -> bool
Check if member is incoming.
sourcefn is_outgoing(member_id: T::MemberId) -> bool
fn is_outgoing(member_id: T::MemberId) -> bool
Check if member is outgoing.
sourcefn is_blacklisted(member_id: T::MemberId) -> bool
fn is_blacklisted(member_id: T::MemberId) -> bool
Check if member is blacklisted.
sourcefn remove_online(member_id: T::MemberId)
fn remove_online(member_id: T::MemberId)
Perform removal from online authorities.
sourcefn remove_out(member_id: T::MemberId)
fn remove_out(member_id: T::MemberId)
Perform removal from outgoing authorities.
sourcefn verify_ownership_and_membership(
who: &T::AccountId
) -> Result<T::MemberId, DispatchError>
fn verify_ownership_and_membership( who: &T::AccountId ) -> Result<T::MemberId, DispatchError>
Check that account is member.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn incoming() -> Vec<T::MemberId>
pub fn incoming() -> Vec<T::MemberId>
An auto-generated getter for IncomingAuthorities
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn online() -> Vec<T::MemberId>
pub fn online() -> Vec<T::MemberId>
An auto-generated getter for OnlineAuthorities
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn outgoing() -> Vec<T::MemberId>
pub fn outgoing() -> Vec<T::MemberId>
An auto-generated getter for OutgoingAuthorities
.
Trait Implementations§
source§impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
source§impl<T> Benchmarking for Pallet<T>
impl<T> Benchmarking for Pallet<T>
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type InCodeStorageVersion = StorageVersion
type InCodeStorageVersion = StorageVersion
source§fn in_code_storage_version() -> Self::InCodeStorageVersion
fn in_code_storage_version() -> Self::InCodeStorageVersion
storage_version
attribute, or
[NoStorageVersionSet
] if the attribute is missing.source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
] instead. Read moresource§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read more§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T> OnOffenceHandler<<T as Config>::AccountId, (<T as Config>::ValidatorId, <T as Config>::FullIdentification), Weight> for Pallet<T>
impl<T> OnOffenceHandler<<T as Config>::AccountId, (<T as Config>::ValidatorId, <T as Config>::FullIdentification), Weight> for Pallet<T>
source§fn on_offence(
offenders: &[OffenceDetails<T::AccountId, IdentificationTuple<T>>],
strategy: SlashStrategy,
_slash_session: SessionIndex
) -> Weight
fn on_offence( offenders: &[OffenceDetails<T::AccountId, IdentificationTuple<T>>], strategy: SlashStrategy, _slash_session: SessionIndex ) -> Weight
source§impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T> PartialEq for Pallet<T>
impl<T> PartialEq for Pallet<T>
source§impl<T: Config> SessionManager<<T as Config>::ValidatorId> for Pallet<T>
impl<T: Config> SessionManager<<T as Config>::ValidatorId> for Pallet<T>
source§fn new_session(_session_index: SessionIndex) -> Option<Vec<T::ValidatorId>>
fn new_session(_session_index: SessionIndex) -> Option<Vec<T::ValidatorId>>
Plan a new session, and optionally provide the new validator set.
Even if the validator-set is the same as before, if any underlying economic conditions have
changed (i.e. stake-weights), the new validator set must be returned. This is necessary for
consensus engines making use of the session pallet to issue a validator-set change so
misbehavior can be provably associated with the new economic conditions as opposed to the
old. The returned validator set, if any, will not be applied until new_index
. new_index
is strictly greater than from previous call.
The first session start at index 0.
new_session(session)
is guaranteed to be called before end_session(session-1)
. In other
words, a new session must always be planned before an ongoing one can be finished.
source§fn new_session_genesis(_new_index: SessionIndex) -> Option<Vec<T::ValidatorId>>
fn new_session_genesis(_new_index: SessionIndex) -> Option<Vec<T::ValidatorId>>
Same as new_session
, but it this should only be called at genesis.
source§fn end_session(_end_index: SessionIndex)
fn end_session(_end_index: SessionIndex)
End the session.
Because the session pallet can queue validator set the ending session can be lower than the last new session index.
source§fn start_session(start_index: SessionIndex)
fn start_session(start_index: SessionIndex)
Start an already planned session.
The session start to be used for validation.
source§impl<T: Config> SessionManager<<T as Config>::ValidatorId, <T as Config>::FullIdentification> for Pallet<T>
impl<T: Config> SessionManager<<T as Config>::ValidatorId, <T as Config>::FullIdentification> for Pallet<T>
source§fn new_session(
new_index: SessionIndex
) -> Option<Vec<(T::ValidatorId, T::FullIdentification)>>
fn new_session( new_index: SessionIndex ) -> Option<Vec<(T::ValidatorId, T::FullIdentification)>>
fn new_session_genesis( new_index: SessionIndex ) -> Option<Vec<(T::ValidatorId, T::FullIdentification)>>
fn start_session(start_index: SessionIndex)
fn end_session(end_index: SessionIndex)
source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.impl<T> Eq for Pallet<T>
Auto Trait Implementations§
impl<T> Freeze for Pallet<T>
impl<T> RefUnwindSafe for Pallet<T>where
T: RefUnwindSafe,
impl<T> Send for Pallet<T>where
T: Send,
impl<T> Sync for Pallet<T>where
T: Sync,
impl<T> Unpin for Pallet<T>where
T: Unpin,
impl<T> UnwindSafe for Pallet<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.