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:
Gavin Wood
2019-10-25 15:14:49 +02:00
committed by GitHub
parent b88b6b5418
commit a0094e72e5
3 changed files with 34 additions and 1 deletions
+11
View File
@@ -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);
}
}
}