Struct pallet_duniter_wot::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§
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: Config> CheckCertAllowed<u32> for Pallet<T>
impl<T: Config> CheckCertAllowed<u32> for Pallet<T>
Implementing certification allowance check for the pallet.
source§fn check_cert_allowed(issuer: u32, receiver: u32) -> Result<(), DispatchError>
fn check_cert_allowed(issuer: u32, receiver: u32) -> Result<(), DispatchError>
Checks if certification is allowed. This implementation checks the following:
- Whether the issuer has an identity.
- Whether the issuer’s identity is a member.
- Whether the receiver has an identity.
- Whether the receiver’s identity is confirmed and not revoked.
source§impl<AccountId, T> CheckIdtyCallAllowed<T> for Pallet<T>
impl<AccountId, T> CheckIdtyCallAllowed<T> for Pallet<T>
Implementing identity call allowance check for the pallet.
source§fn check_create_identity(creator: u32) -> Result<(), DispatchError>
fn check_create_identity(creator: u32) -> Result<(), DispatchError>
Checks if identity creation is allowed. This implementation checks the following:
- Whether the identity has the right to create an identity.
- Whether the issuer can emit a certification.
- Whether the issuer respect creation period.
source§impl<T: Config> CheckMembershipOpAllowed<u32> for Pallet<T>
impl<T: Config> CheckMembershipOpAllowed<u32> for Pallet<T>
Implementing membership operation checks for the pallet.
source§fn check_add_membership(idty_index: u32) -> Result<(), DispatchError>
fn check_add_membership(idty_index: u32) -> Result<(), DispatchError>
This implementation checks the following:
- Whether the identity’s status is unvalidated or not a member.
- The count of certifications associated with the identity.
source§fn check_renew_membership(idty_index: u32) -> Result<(), DispatchError>
fn check_renew_membership(idty_index: u32) -> Result<(), DispatchError>
This implementation checks the following:
- Whether the identity’s status is member.
Note: There is no need to check certification count since losing certifications makes membership expire. Membership renewal is only possible when identity is member.
source§impl<T: Config + Config> CheckRequestDistanceEvaluation<T> for Pallet<T>
impl<T: Config + Config> CheckRequestDistanceEvaluation<T> for Pallet<T>
Implementing the request distance evaluation check for the pallet.
source§fn check_request_distance_evaluation(
idty_index: u32
) -> Result<(), DispatchError>
fn check_request_distance_evaluation( idty_index: u32 ) -> Result<(), DispatchError>
This implementation performs the following checks:
- Membership renewal anti-spam check: Ensures that membership renewal requests respect the anti-spam period.
- Certificate count check: Ensures that the identity has a sufficient number of certificates.
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: Config> OnNewIdty<T> for Pallet<T>
impl<T: Config> OnNewIdty<T> for Pallet<T>
Implementing the identity event handler for the pallet.
source§fn on_created(idty_index: &u32, creator: &u32)
fn on_created(idty_index: &u32, creator: &u32)
This implementation adds a certificate when a new identity is created.
source§impl<T> OnNewMembership<u32> for Pallet<T>
impl<T> OnNewMembership<u32> for Pallet<T>
Implementing membership event handling for the pallet.
source§fn on_created(idty_index: &u32)
fn on_created(idty_index: &u32)
This implementation notifies the identity pallet when a main membership is acquired. It is only used on the first membership acquisition.
source§fn on_renewed(_idty_index: &u32)
fn on_renewed(_idty_index: &u32)
source§impl<T: Config> OnNewcert<u32> for Pallet<T>
impl<T: Config> OnNewcert<u32> for Pallet<T>
Implementing the certification event handler for the pallet.
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> OnRemoveIdty<T> for Pallet<T>
impl<T: Config> OnRemoveIdty<T> for Pallet<T>
Implementing identity removal event handling for the pallet.
source§fn on_removed(idty_index: &u32) -> Weight
fn on_removed(idty_index: &u32) -> Weight
This implementation removes both membership and certificates associated with the identity.
source§fn on_revoked(idty_index: &u32) -> Weight
fn on_revoked(idty_index: &u32) -> Weight
This implementation removes membership only.
source§impl<T> OnRemoveMembership<u32> for Pallet<T>
impl<T> OnRemoveMembership<u32> for Pallet<T>
Implementing membership removal event handling for the pallet.
source§fn on_removed(idty_index: &u32) -> Weight
fn on_removed(idty_index: &u32) -> Weight
This implementation notifies the identity pallet when a main membership is lost.
source§impl<T: Config> OnRemovedCert<u32> for Pallet<T>
impl<T: Config> OnRemovedCert<u32> for Pallet<T>
Implementing the certification removal event handler for the pallet.
source§fn on_removed_cert(
_issuer: u32,
_issuer_issued_count: u32,
receiver: u32,
receiver_received_count: u32,
_expiration: bool
)
fn on_removed_cert( _issuer: u32, _issuer_issued_count: u32, receiver: u32, receiver_received_count: u32, _expiration: bool )
This implementation checks if the receiver has received fewer certificates than required for membership, and if so, and the receiver is a member, it expires the receiver’s membership.
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 + Config> OnValidDistanceStatus<T> for Pallet<T>
impl<T: Config + Config> OnValidDistanceStatus<T> for Pallet<T>
Implementing the valid distance status event handler for the pallet.
source§fn on_valid_distance_status(idty_index: u32)
fn on_valid_distance_status(idty_index: u32)
This implementation handles different scenarios based on the identity’s status:
- For
Unconfirmed
orRevoked
identities, no action is taken. - For
Unvalidated
orNotMember
identities, an attempt is made to add membership. - For
Member
identities, an attempt is made to renew membership.
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> 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
.