Struct pallet_duniter_account::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 unlink_identity(origin: OriginFor<T>) -> DispatchResultWithPostInfo
pub fn unlink_identity(origin: OriginFor<T>) -> DispatchResultWithPostInfo
Unlink the identity associated with the account.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn do_unlink_identity(account_id: T::AccountId)
pub fn do_unlink_identity(account_id: T::AccountId)
Unlink the account from its associated identity.
sourcepub fn do_link_identity(account_id: &T::AccountId, idty_id: IdtyIdOf<T>)
pub fn do_link_identity(account_id: &T::AccountId, idty_id: IdtyIdOf<T>)
Link an account to an identity.
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>where
T: Config + Config,
impl<T> Benchmarking for Pallet<T>where
T: Config + Config,
source§impl<AccountId, T> CheckAccountWorthiness<T> for Pallet<T>
impl<AccountId, T> CheckAccountWorthiness<T> for Pallet<T>
Implementation of the CheckAccountWorthiness trait for the Pallet. This trait is used to verify the worthiness of an account in terms of existence and sufficient balance to handle identity creation.
source§fn check_account_worthiness(account: &AccountId) -> Result<(), DispatchError>
fn check_account_worthiness(account: &AccountId) -> Result<(), DispatchError>
Checks that the account exists and has the balance to handle the identity creation process.
source§fn set_worthy(account: &AccountId)
fn set_worthy(account: &AccountId)
Set an account as worthy. Only available for runtime benchmarks.
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>
§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> 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> LinkIdty<<T as Config>::AccountId, <T as Config>::IdtyIndex> for Pallet<T>where
T: Config,
impl<T> LinkIdty<<T as Config>::AccountId, <T as Config>::IdtyIndex> for Pallet<T>where
T: Config,
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> OnChargeTransaction<T> for Pallet<T>where
T::RuntimeCall: IsSubType<Call<T>>,
T::InnerOnChargeTransaction: OnChargeTransaction<T, Balance = BalanceOf<T>, LiquidityInfo = Option<Credit<T::AccountId, T::Currency>>>,
impl<T: Config> OnChargeTransaction<T> for Pallet<T>where
T::RuntimeCall: IsSubType<Call<T>>,
T::InnerOnChargeTransaction: OnChargeTransaction<T, Balance = BalanceOf<T>, LiquidityInfo = Option<Credit<T::AccountId, T::Currency>>>,
§type Balance = <Pallet<T> as Inspect<<T as Config>::AccountId>>::Balance
type Balance = <Pallet<T> as Inspect<<T as Config>::AccountId>>::Balance
The underlying integer type in which fees are calculated.
type LiquidityInfo = Option<Imbalance<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, <<T as Config>::Currency as Balanced<<T as Config>::AccountId>>::OnDropCredit, <<T as Config>::Currency as Balanced<<T as Config>::AccountId>>::OnDropDebt>>
source§fn withdraw_fee(
who: &T::AccountId,
call: &T::RuntimeCall,
dispatch_info: &DispatchInfoOf<T::RuntimeCall>,
fee: Self::Balance,
tip: Self::Balance
) -> Result<Self::LiquidityInfo, TransactionValidityError>
fn withdraw_fee( who: &T::AccountId, call: &T::RuntimeCall, dispatch_info: &DispatchInfoOf<T::RuntimeCall>, fee: Self::Balance, tip: Self::Balance ) -> Result<Self::LiquidityInfo, TransactionValidityError>
Before the transaction is executed the payment of the transaction fees
need to be secured. Read more
source§fn correct_and_deposit_fee(
who: &T::AccountId,
dispatch_info: &DispatchInfoOf<T::RuntimeCall>,
post_info: &PostDispatchInfoOf<T::RuntimeCall>,
corrected_fee: Self::Balance,
tip: Self::Balance,
already_withdrawn: Self::LiquidityInfo
) -> Result<(), TransactionValidityError>
fn correct_and_deposit_fee( who: &T::AccountId, dispatch_info: &DispatchInfoOf<T::RuntimeCall>, post_info: &PostDispatchInfoOf<T::RuntimeCall>, corrected_fee: Self::Balance, tip: Self::Balance, already_withdrawn: Self::LiquidityInfo ) -> Result<(), TransactionValidityError>
After the transaction was executed the actual fee can be calculated.
This function should refund any overpaid fees and optionally deposit
the corrected amount. 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, AccountId, Balance> StoredMap<AccountId, AccountData<Balance>> for Pallet<T>where
AccountId: Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + Ord + Into<[u8; 32]> + MaxEncodedLen,
Balance: Parameter + Member + AtLeast32BitUnsigned + Codec + Default + Copy + MaybeSerializeDeserialize + Debug + MaxEncodedLen + TypeInfo,
T: Config + Config<AccountId = AccountId, AccountData = AccountData<Balance, IdtyIdOf<T>>> + Config<Balance = Balance>,
impl<T, AccountId, Balance> StoredMap<AccountId, AccountData<Balance>> for Pallet<T>where
AccountId: Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + Ord + Into<[u8; 32]> + MaxEncodedLen,
Balance: Parameter + Member + AtLeast32BitUnsigned + Codec + Default + Copy + MaybeSerializeDeserialize + Debug + MaxEncodedLen + TypeInfo,
T: Config + Config<AccountId = AccountId, AccountData = AccountData<Balance, IdtyIdOf<T>>> + Config<Balance = Balance>,
source§fn get(k: &AccountId) -> AccountData<Balance>
fn get(k: &AccountId) -> AccountData<Balance>
Get the item, or its default if it doesn’t yet exist; we make no distinction between the
two.
source§fn try_mutate_exists<R, E: From<DispatchError>>(
account_id: &AccountId,
f: impl FnOnce(&mut Option<AccountData<Balance>>) -> Result<R, E>
) -> Result<R, E>
fn try_mutate_exists<R, E: From<DispatchError>>( account_id: &AccountId, f: impl FnOnce(&mut Option<AccountData<Balance>>) -> Result<R, E> ) -> Result<R, E>
Maybe mutate the item only if an
Ok
value is returned from f
. Do nothing if an Err
is
returned. It is removed or reset to default value if it has been mutated to None
.
f
will always be called with an option representing if the storage item exists (Some<V>
)
or if the storage item does not exist (None
), independent of the QueryType
.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
.