pub type Recovery = Pallet<Runtime>;
Aliased Type§
struct Recovery(/* private fields */);
Implementations
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn recovery_config<KArg>(
k: KArg,
) -> Option<RecoveryConfig<<<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, BoundedVec<<T as Config>::AccountId, <T as Config>::MaxFriends>>>
pub fn recovery_config<KArg>( k: KArg, ) -> Option<RecoveryConfig<<<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, BoundedVec<<T as Config>::AccountId, <T as Config>::MaxFriends>>>
An auto-generated getter for Recoverable
.
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn active_recovery<KArg1, KArg2>(
k1: KArg1,
k2: KArg2,
) -> Option<ActiveRecovery<<<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, BoundedVec<<T as Config>::AccountId, <T as Config>::MaxFriends>>>
pub fn active_recovery<KArg1, KArg2>( k1: KArg1, k2: KArg2, ) -> Option<ActiveRecovery<<<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, BoundedVec<<T as Config>::AccountId, <T as Config>::MaxFriends>>>
An auto-generated getter for ActiveRecoveries
.
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn as_recovered(
origin: <T as Config>::RuntimeOrigin,
account: <<T as Config>::Lookup as StaticLookup>::Source,
call: Box<<T as Config>::RuntimeCall>,
) -> Result<(), DispatchError>
pub fn as_recovered( origin: <T as Config>::RuntimeOrigin, account: <<T as Config>::Lookup as StaticLookup>::Source, call: Box<<T as Config>::RuntimeCall>, ) -> Result<(), DispatchError>
Send a call through a recovered account.
The dispatch origin for this call must be Signed and registered to be able to make calls on behalf of the recovered account.
Parameters:
account
: The recovered account you want to make a call on-behalf-of.call
: The call you want to make with the recovered account.
Sourcepub fn set_recovered(
origin: <T as Config>::RuntimeOrigin,
lost: <<T as Config>::Lookup as StaticLookup>::Source,
rescuer: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn set_recovered( origin: <T as Config>::RuntimeOrigin, lost: <<T as Config>::Lookup as StaticLookup>::Source, rescuer: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Allow ROOT to bypass the recovery process and set a rescuer account for a lost account directly.
The dispatch origin for this call must be ROOT.
Parameters:
lost
: The “lost account” to be recovered.rescuer
: The “rescuer account” which can call as the lost account.
Sourcepub fn create_recovery(
origin: <T as Config>::RuntimeOrigin,
friends: Vec<<T as Config>::AccountId>,
threshold: u16,
delay_period: <<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber,
) -> Result<(), DispatchError>
pub fn create_recovery( origin: <T as Config>::RuntimeOrigin, friends: Vec<<T as Config>::AccountId>, threshold: u16, delay_period: <<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, ) -> Result<(), DispatchError>
Create a recovery configuration for your account. This makes your account recoverable.
Payment: ConfigDepositBase
+ FriendDepositFactor
* #_of_friends balance
will be reserved for storing the recovery configuration. This deposit is returned
in full when the user calls remove_recovery
.
The dispatch origin for this call must be Signed.
Parameters:
friends
: A list of friends you trust to vouch for recovery attempts. Should be ordered and contain no duplicate values.threshold
: The number of friends that must vouch for a recovery attempt before the account can be recovered. Should be less than or equal to the length of the list of friends.delay_period
: The number of blocks after a recovery attempt is initialized that needs to pass before the account can be recovered.
Sourcepub fn initiate_recovery(
origin: <T as Config>::RuntimeOrigin,
account: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn initiate_recovery( origin: <T as Config>::RuntimeOrigin, account: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Initiate the process for recovering a recoverable account.
Payment: RecoveryDeposit
balance will be reserved for initiating the
recovery process. This deposit will always be repatriated to the account
trying to be recovered. See close_recovery
.
The dispatch origin for this call must be Signed.
Parameters:
account
: The lost account that you want to recover. This account needs to be recoverable (i.e. have a recovery configuration).
Sourcepub fn vouch_recovery(
origin: <T as Config>::RuntimeOrigin,
lost: <<T as Config>::Lookup as StaticLookup>::Source,
rescuer: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn vouch_recovery( origin: <T as Config>::RuntimeOrigin, lost: <<T as Config>::Lookup as StaticLookup>::Source, rescuer: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Allow a “friend” of a recoverable account to vouch for an active recovery process for that account.
The dispatch origin for this call must be Signed and must be a “friend” for the recoverable account.
Parameters:
lost
: The lost account that you want to recover.rescuer
: The account trying to rescue the lost account that you want to vouch for.
The combination of these two parameters must point to an active recovery process.
Sourcepub fn claim_recovery(
origin: <T as Config>::RuntimeOrigin,
account: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn claim_recovery( origin: <T as Config>::RuntimeOrigin, account: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Allow a successful rescuer to claim their recovered account.
The dispatch origin for this call must be Signed and must be a “rescuer”
who has successfully completed the account recovery process: collected
threshold
or more vouches, waited delay_period
blocks since initiation.
Parameters:
account
: The lost account that you want to claim has been successfully recovered by you.
Sourcepub fn close_recovery(
origin: <T as Config>::RuntimeOrigin,
rescuer: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn close_recovery( origin: <T as Config>::RuntimeOrigin, rescuer: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
As the controller of a recoverable account, close an active recovery process for your account.
Payment: By calling this function, the recoverable account will receive
the recovery deposit RecoveryDeposit
placed by the rescuer.
The dispatch origin for this call must be Signed and must be a recoverable account with an active recovery process for it.
Parameters:
rescuer
: The account trying to rescue this recoverable account.
Sourcepub fn remove_recovery(
origin: <T as Config>::RuntimeOrigin,
) -> Result<(), DispatchError>
pub fn remove_recovery( origin: <T as Config>::RuntimeOrigin, ) -> Result<(), DispatchError>
Remove the recovery process for your account. Recovered accounts are still accessible.
NOTE: The user must make sure to call close_recovery
on all active
recovery attempts before calling this function else it will fail.
Payment: By calling this function the recoverable account will unreserve
their recovery configuration deposit.
(ConfigDepositBase
+ FriendDepositFactor
* #_of_friends)
The dispatch origin for this call must be Signed and must be a recoverable account (i.e. has a recovery configuration).
Sourcepub fn cancel_recovered(
origin: <T as Config>::RuntimeOrigin,
account: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn cancel_recovered( origin: <T as Config>::RuntimeOrigin, account: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Cancel the ability to use as_recovered
for account
.
The dispatch origin for this call must be Signed and registered to be able to make calls on behalf of the recovered account.
Parameters:
account
: The recovered account you are able to call on-behalf-of.
Sourcepub fn poke_deposit(
origin: <T as Config>::RuntimeOrigin,
maybe_account: Option<<<T as Config>::Lookup as StaticLookup>::Source>,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn poke_deposit( origin: <T as Config>::RuntimeOrigin, maybe_account: Option<<<T as Config>::Lookup as StaticLookup>::Source>, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Poke deposits for recovery configurations and / or active recoveries.
This can be used by accounts to possibly lower their locked amount.
The dispatch origin for this call must be Signed.
Parameters:
maybe_account
: Optional recoverable account for which you have an active recovery and want to adjust the deposit for the active recovery.
This function checks both recovery configuration deposit and active recovery deposits of the caller:
- If the caller has created a recovery configuration, checks and adjusts its deposit
- If the caller has initiated any active recoveries, and provides the account in
maybe_account
, checks and adjusts those deposits
If any deposit is updated, the difference will be reserved/unreserved from the caller’s account.
The transaction is made free if any deposit is updated and paid otherwise.
Emits DepositPoked
if any deposit is updated.
Multiple events may be emitted in case both types of deposits are updated.
Trait Implementations
Source§impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
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§fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
Source§fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Source§impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
fn dispatch_view_function<O>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>where
O: Output,
Source§impl<T> GetStorageVersion for Pallet<T>where
T: Config,
impl<T> GetStorageVersion for Pallet<T>where
T: Config,
Source§fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Source§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> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
Source§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read moreSource§fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Source§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
Source§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§fn integrity_test()
fn integrity_test()
Source§impl<T> IntegrityTest for Pallet<T>where
T: Config,
impl<T> IntegrityTest for Pallet<T>where
T: Config,
Source§impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_finalize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Hooks::on_finalize
.Source§impl<T> OnGenesis for Pallet<T>where
T: Config,
impl<T> OnGenesis for Pallet<T>where
T: Config,
Source§fn on_genesis()
fn on_genesis()
Source§impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_initialize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Weight
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Hooks::on_initialize
.Source§impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Hooks::pre_upgrade
.Source§fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
Hooks::post_upgrade
.Source§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moreSource§impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
Source§impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
fn storage_info() -> Vec<StorageInfo>
Source§impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
Source§fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
Ok(bytes_decoded)
if success.Source§impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
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.