Struct pallet_membership::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>
sourcefn unschedule_membership_expiry(
idty_id: T::IdtyId,
block_number: BlockNumberFor<T>
)
fn unschedule_membership_expiry( idty_id: T::IdtyId, block_number: BlockNumberFor<T> )
Unschedules membership expiry.
sourcefn insert_membership_and_schedule_expiry(
idty_id: T::IdtyId
) -> BlockNumberFor<T>
fn insert_membership_and_schedule_expiry( idty_id: T::IdtyId ) -> BlockNumberFor<T>
Insert membership and schedule its expiry.
sourcepub fn check_add_membership(idty_id: T::IdtyId) -> Result<(), DispatchError>
pub fn check_add_membership(idty_id: T::IdtyId) -> Result<(), DispatchError>
Check if membership can be claimed.
sourcepub fn check_renew_membership(
idty_id: T::IdtyId
) -> Result<MembershipData<BlockNumberFor<T>>, DispatchError>
pub fn check_renew_membership( idty_id: T::IdtyId ) -> Result<MembershipData<BlockNumberFor<T>>, DispatchError>
Check if membership renewal is allowed.
sourcepub fn try_add_membership(idty_id: T::IdtyId) -> Result<(), DispatchError>
pub fn try_add_membership(idty_id: T::IdtyId) -> Result<(), DispatchError>
Attempt to add membership.
sourcepub fn try_renew_membership(idty_id: T::IdtyId) -> Result<(), DispatchError>
pub fn try_renew_membership(idty_id: T::IdtyId) -> Result<(), DispatchError>
Attempt to renew membership.
sourcefn do_add_membership(idty_id: T::IdtyId)
fn do_add_membership(idty_id: T::IdtyId)
Perform membership addition.
sourcefn do_renew_membership(
idty_id: T::IdtyId,
membership_data: MembershipData<BlockNumberFor<T>>
)
fn do_renew_membership( idty_id: T::IdtyId, membership_data: MembershipData<BlockNumberFor<T>> )
Perform membership renewal.
sourcepub fn do_remove_membership(
idty_id: T::IdtyId,
reason: MembershipRemovalReason
) -> Weight
pub fn do_remove_membership( idty_id: T::IdtyId, reason: MembershipRemovalReason ) -> Weight
Perform membership removal.
sourcepub fn expire_memberships(block_number: BlockNumberFor<T>) -> Weight
pub fn expire_memberships(block_number: BlockNumberFor<T>) -> Weight
Perform membership expiry scheduled at the given block number.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn membership<KArg>(k: KArg) -> Option<MembershipData<BlockNumberFor<T>>>where
KArg: EncodeLike<T::IdtyId>,
pub fn membership<KArg>(k: KArg) -> Option<MembershipData<BlockNumberFor<T>>>where
KArg: EncodeLike<T::IdtyId>,
An auto-generated getter for Membership
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn memberships_expire_on<KArg>(k: KArg) -> Vec<T::IdtyId>where
KArg: EncodeLike<BlockNumberFor<T>>,
pub fn memberships_expire_on<KArg>(k: KArg) -> Vec<T::IdtyId>where
KArg: EncodeLike<BlockNumberFor<T>>,
An auto-generated getter for MembershipsExpireOn
.
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
Something that should happen before runtime migrations are executed.
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
Returns the in-code storage version as specified in the
storage_version
attribute, or
[NoStorageVersionSet
] if the attribute is missing.source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Returns the storage version of the pallet as last set in the actual on-chain storage.
§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
👎Deprecated: This method has been renamed to
in_code_storage_version
and will be removed after March 2024.DEPRECATED: Use [
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>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read more
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
Block finalization hook. This is called at the very end of block execution. Read more
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[
Hooks::on_finalize
]). Read more§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
A hook to run logic after inherent application. Read more
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME
Executive
pallet. Read more§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
dispatched as separate threads, and entirely independent of the main blockchain execution. Read more
§fn integrity_test()
fn integrity_test()
Check the integrity of this pallet’s configuration. Read more
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
See [
Hooks::integrity_test
].source§impl<T: Config> MembersCount for Pallet<T>
impl<T: Config> MembersCount for Pallet<T>
source§fn members_count() -> u32
fn members_count() -> u32
The count of members.
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>)
This function is being called after every block import (when fully synced). Read more
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>)
See [
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()
Something that should happen at 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
See [
Hooks::on_initialize
].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
See [
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
Name of the Rust module containing the pallet.
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Version of the crate containing the pallet.
source§impl<T> PartialEq for Pallet<T>
impl<T> PartialEq for Pallet<T>
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>
Returns a
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
Mutably borrows from an owned value. Read more
§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
Compare self to
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
Checks if this value is equivalent to the given key. Read more
§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>
Converts
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>
Converts
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>,
Consume self to return an equivalent value of
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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
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
The counterpart to
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
Consume self to return an equivalent value of
T
.