From 202271d0a1e65991085102764031634bcc2d31a1 Mon Sep 17 00:00:00 2001 From: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Date: Fri, 6 Sep 2019 13:39:55 +0200 Subject: [PATCH] Remove dead code in Staking (#3559) * Remove some dead code from staking * Fix var name. --- substrate/srml/staking/src/lib.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/substrate/srml/staking/src/lib.rs b/substrate/srml/staking/src/lib.rs index 0f8bc5c09a1..837d12960d5 100644 --- a/substrate/srml/staking/src/lib.rs +++ b/substrate/srml/staking/src/lib.rs @@ -1001,8 +1001,8 @@ impl<T: Trait> Module<T> { /// The total balance that can be slashed from a validator controller account as of /// right now. - pub fn slashable_balance(who: &T::AccountId) -> BalanceOf<T> { - Self::stakers(who).total + pub fn slashable_balance_of(stash: &T::AccountId) -> BalanceOf<T> { + Self::bonded(stash).and_then(Self::ledger).map(|l| l.active).unwrap_or_default() } // MUTABLES (DANGEROUS) @@ -1231,10 +1231,6 @@ impl<T: Trait> Module<T> { maybe_new_validators } - fn slashable_balance_of(stash: &T::AccountId) -> BalanceOf<T> { - Self::bonded(stash).and_then(Self::ledger).map(|l| l.active).unwrap_or_default() - } - /// Select a new validator set from the assembled stakers and their role preferences. /// /// Returns the new `SlotStake` value and a set of newly selected _stash_ IDs. -- GitLab