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;
}
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
.
Object Safety§
This trait is not object safe.