Tip payment is a different withdraw reason. (#3937)

* Tip payment is a different withdraw reason.

* Bump runtime version.

* Test fix.

* Fix lock type
This commit is contained in:
Gavin Wood
2019-10-28 13:04:20 +01:00
committed by GitHub
parent e110cd7ae8
commit ec7655cc7b
11 changed files with 49 additions and 40 deletions
+1 -1
View File
@@ -642,7 +642,7 @@ fn transfer<'a, T: Trait, V: Vm<T>, L: Loader<T>>(
if would_create && value < ctx.config.existential_deposit {
return Err("value too low to create account");
}
T::Currency::ensure_can_withdraw(transactor, value, WithdrawReason::Transfer, new_from_balance)?;
T::Currency::ensure_can_withdraw(transactor, value, WithdrawReason::Transfer.into(), new_from_balance)?;
let new_to_balance = match to_balance.checked_add(&value) {
Some(b) => b,
+1 -1
View File
@@ -215,7 +215,7 @@ pub fn buy_gas<T: Trait>(
let imbalance = T::Currency::withdraw(
transactor,
cost,
WithdrawReason::Fee,
WithdrawReason::Fee.into(),
ExistenceRequirement::KeepAlive
)?;
+2 -2
View File
@@ -119,7 +119,7 @@ fn try_evict_or_and_pay_rent<T: Trait>(
let can_withdraw_rent = T::Currency::ensure_can_withdraw(
account,
dues_limited,
WithdrawReason::Fee,
WithdrawReason::Fee.into(),
balance.saturating_sub(dues_limited),
)
.is_ok();
@@ -129,7 +129,7 @@ fn try_evict_or_and_pay_rent<T: Trait>(
let imbalance = T::Currency::withdraw(
account,
dues_limited,
WithdrawReason::Fee,
WithdrawReason::Fee.into(),
ExistenceRequirement::KeepAlive,
)
.expect(