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.
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.