pub fn change_staking_target<T: Config>(
from: MessageSourceId,
to: MessageSourceId,
amount: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance,
)Expand description
Sets the target of the staking capacity to a new target.
This adds a chunk to StakingDetails.stake_change_unlocking chunks, up to T::MaxUnlockingChunks.
The staked amount and Capacity generated by amount originally targeted to the from MSA Id is reassigned to the to MSA Id.
Does not affect unstaking process or additional stake amounts.
Changing a staking target to a Provider when Origin has nothing staked them will retain the staking type.
Changing a staking target to a Provider when Origin has any amount staked to them will error if the staking types are not the same.
§Errors
Error::MaxUnlockingChunksExceededifstake_change_unlocking_chunks==T::MaxUnlockingChunksError::StakerTargetRelationshipNotFoundiffromis not a target for Origin’s staking account.Error::StakingAmountBelowMinimumifamountto retarget is below the minimum staking amount.Error::InsufficientStakingBalanceifamountto retarget exceeds what the staker has targeted tofromMSA Id.Error::InvalidTargetiftodoes not belong to a registered Provider.Error::MaxRetargetsExceededif origin has reached the maximimum number of retargets for the current RewardEra.
§Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::change_staking_target.