referrerpolicy=no-referrer-when-downgrade

FriendGroupOf

Type Alias FriendGroupOf 

Source
pub type FriendGroupOf<T> = FriendGroup<ProvidedBlockNumberOf<T>, AccountIdFor<T>, FriendsOf<T>>;
Expand description

A FriendGroup for a specific Config.

Aliased Type§

pub struct FriendGroupOf<T> {
    pub friends: BoundedVec<<T as Config>::AccountId, <T as Config>::MaxFriendsPerConfig>,
    pub friends_needed: u32,
    pub inheritor: <T as Config>::AccountId,
    pub inheritance_delay: <<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber,
    pub inheritance_priority: u32,
    pub cancel_delay: <<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber,
}

Fields§

§friends: BoundedVec<<T as Config>::AccountId, <T as Config>::MaxFriendsPerConfig>

List of friends that can initiate the recovery process. Always sorted.

§friends_needed: u32

The number of approving friends needed to recover an account.

§inheritor: <T as Config>::AccountId

The account that will inherit full access to the lost account upon successful recovery.

§inheritance_delay: <<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber

Minimum time that a recovery attempt must stay active before it can be finished.

Uses a provided block number to avoid possible clock skew of parachains.

§inheritance_priority: u32

Used to resolve inheritance conflicts when multiple friend groups finish a recovery.

Higher-priority friend groups can replace the inheritor of a lower-priority group. For example: you can set your family group as priority 0, your friends group as priority 1 and co-workers as priority 2. This in combination with the inheritance_delay enables you to ensure that the correct group receives the inheritance. See InheritancePriority for the numeric convention.

§cancel_delay: <<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber

The delay since the last approval of an attempt before the attempt can be canceled.

It ensures that a malicious recoverer does not abuse the cancel_attempt call to dodge an incoming slash from the lost account. They could otherwise monitor the TX pool and cancel the attempt just in time for the slash transaction to fail. Now instead, the lost account has at least cancel_delay provided blocks to slash the attempt.