referrerpolicy=no-referrer-when-downgrade

Trait sp_staking::DelegationMigrator

source ·
pub trait DelegationMigrator {
    type Balance: Sub<Output = Self::Balance> + Ord + PartialEq + Default + Copy + MaxEncodedLen + FullCodec + TypeInfo + Saturating;
    type AccountId: Clone + Debug;

    // Required methods
    fn migrate_nominator_to_agent(
        agent: Agent<Self::AccountId>,
        reward_account: &Self::AccountId,
    ) -> DispatchResult;
    fn migrate_delegation(
        agent: Agent<Self::AccountId>,
        delegator: Delegator<Self::AccountId>,
        value: Self::Balance,
    ) -> DispatchResult;
    fn force_kill_agent(agent: Agent<Self::AccountId>);
}
Expand description

Trait to provide functionality for direct stakers to migrate to delegation agents. See DelegationInterface for more details on delegation.

Required Associated Types§

source

type Balance: Sub<Output = Self::Balance> + Ord + PartialEq + Default + Copy + MaxEncodedLen + FullCodec + TypeInfo + Saturating

Balance type used by the staking system.

source

type AccountId: Clone + Debug

AccountId type used by the staking system.

Required Methods§

source

fn migrate_nominator_to_agent( agent: Agent<Self::AccountId>, reward_account: &Self::AccountId, ) -> DispatchResult

Migrate an existing Nominator to Agent account.

The implementation should ensure the Nominator account funds are moved to an escrow from which Agents can later release funds to its Delegators.

source

fn migrate_delegation( agent: Agent<Self::AccountId>, delegator: Delegator<Self::AccountId>, value: Self::Balance, ) -> DispatchResult

Migrate value of delegation to delegator from a migrating agent.

When a direct Nominator migrates to Agent, the funds are kept in escrow. This function allows the Agent to release the funds to the delegator.

source

fn force_kill_agent(agent: Agent<Self::AccountId>)

Drop the Agent account and its associated delegators.

Also removed from StakingUnchecked as a Virtual Staker. Useful for testing.

Object Safety§

This trait is not object safe.

Implementors§