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§
Required Methods§
sourcefn migrate_nominator_to_agent(
agent: Agent<Self::AccountId>,
reward_account: &Self::AccountId,
) -> DispatchResult
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
.
sourcefn migrate_delegation(
agent: Agent<Self::AccountId>,
delegator: Delegator<Self::AccountId>,
value: Self::Balance,
) -> DispatchResult
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
.
sourcefn force_kill_agent(agent: Agent<Self::AccountId>)
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.