make pool roles optional (#11411)

* make pool roles optional

* undo lock file changes?

* add migration

* Fix

* fix review comments
This commit is contained in:
Kian Paimani
2022-05-15 08:25:48 +01:00
committed by GitHub
parent 8a45870878
commit 88dbef8336
8 changed files with 400 additions and 72 deletions
+5 -2
View File
@@ -533,10 +533,12 @@ impl<T: Config> StakingLedger<T> {
/// case that either the active bonded or some unlocking chunks become dust after slashing.
/// Returns the amount of funds actually slashed.
///
/// `slash_era` is the era in which the slash (which is being enacted now) actually happened.
///
/// # Note
///
/// This calls `Config::OnStakerSlash::on_slash` with information as to how the slash
/// was applied.
/// This calls `Config::OnStakerSlash::on_slash` with information as to how the slash was
/// applied.
fn slash(
&mut self,
slash_amount: BalanceOf<T>,
@@ -615,6 +617,7 @@ impl<T: Config> StakingLedger<T> {
break
}
}
self.unlocking.retain(|c| !c.value.is_zero());
T::OnStakerSlash::on_slash(&self.stash, self.active, &slashed_unlocking);
pre_slash_total.saturating_sub(self.total)