mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 18:15:48 +00:00
Add force_unstake to staking as root operation. (#3918)
* Add force_unstake to staking as root operation. * Bump runtime * Tests * Update srml/staking/src/lib.rs Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -993,6 +993,17 @@ decl_module! {
|
||||
ensure_root(origin)?;
|
||||
<Invulnerables<T>>::put(validators);
|
||||
}
|
||||
|
||||
/// Force a current staker to become completely unstaked, immediately.
|
||||
#[weight = sr_primitives::SimpleDispatchInfo::FreeOperational]
|
||||
fn force_unstake(origin, stash: T::AccountId) {
|
||||
ensure_root(origin)?;
|
||||
|
||||
// remove the lock.
|
||||
T::Currency::remove_lock(STAKING_ID, &stash);
|
||||
// remove all staking-related information.
|
||||
Self::kill_stash(&stash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user