referrerpolicy=no-referrer-when-downgrade
polkadot_runtime_common::identity_migrator

Trait OnReapIdentity

Source
pub trait OnReapIdentity<AccountId> {
    // Required methods
    fn on_reap_identity(
        who: &AccountId,
        bytes: u32,
        subs: u32,
    ) -> DispatchResult;
    fn ensure_successful_identity_reaping(
        who: &AccountId,
        bytes: u32,
        subs: u32,
    );
}
Expand description

Trait to handle reaping identity from state.

Required Methods§

Source

fn on_reap_identity(who: &AccountId, bytes: u32, subs: u32) -> DispatchResult

What to do when an identity is reaped. For example, the implementation could send an XCM program to another chain. Concretely, a type implementing this trait in the Polkadot runtime would teleport enough DOT to the People Chain to cover the Identity deposit there.

This could also directly include Transact { poke_deposit(..), ..}.

Inputs

  • who: Whose identity was reaped.
  • bytes: The byte size of IdentityInfo.
  • subs: The number of sub-accounts they had.
Source

fn ensure_successful_identity_reaping(who: &AccountId, bytes: u32, subs: u32)

Ensure that identity reaping will be succesful in benchmarking.

Should setup the state in a way that the same call ot [Self::on_reap_identity] will be successful.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<AccountId> OnReapIdentity<AccountId> for ()

Source§

fn on_reap_identity(_who: &AccountId, _bytes: u32, _subs: u32) -> DispatchResult

Source§

fn ensure_successful_identity_reaping(_: &AccountId, _: u32, _: u32)

Implementors§