Sensible locking for staking and council. (#3050)

* Sensible locking for staking and council.

* Bump.
This commit is contained in:
Kian Peymani
2019-07-10 20:03:14 +02:00
committed by Gavin Wood
parent ddfc761dbf
commit 814b9056b3
5 changed files with 61 additions and 11 deletions
+4 -3
View File
@@ -278,7 +278,7 @@ use srml_support::{
StorageValue, StorageMap, EnumerableStorageMap, decl_module, decl_event,
decl_storage, ensure, traits::{
Currency, OnFreeBalanceZero, OnDilution, LockIdentifier, LockableCurrency,
WithdrawReasons, OnUnbalanced, Imbalance, Get
WithdrawReasons, WithdrawReason, OnUnbalanced, Imbalance, Get
}
};
use session::{historical::OnSessionEnding, SelectInitialValidators, SessionIndex};
@@ -969,7 +969,8 @@ impl<T: Trait> Module<T> {
// MUTABLES (DANGEROUS)
/// Update the ledger for a controller. This will also update the stash lock.
/// Update the ledger for a controller. This will also update the stash lock. The lock will
/// will lock the entire funds except paying for further transactions.
fn update_ledger(
controller: &T::AccountId,
ledger: &StakingLedger<T::AccountId, BalanceOf<T>>
@@ -979,7 +980,7 @@ impl<T: Trait> Module<T> {
&ledger.stash,
ledger.total,
T::BlockNumber::max_value(),
WithdrawReasons::all()
WithdrawReasons::except(WithdrawReason::TransactionPayment),
);
<Ledger<T>>::insert(controller, ledger);
}