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
@@ -171,11 +171,16 @@ impl<T: Trait + Send + Sync> SignedExtension for ChargeTransactionPayment<T>
len: usize,
) -> TransactionValidity {
// pay any fees.
let fee = Self::compute_fee(len, info, self.0);
let tip = self.0;
let fee = Self::compute_fee(len, info, tip);
let imbalance = match T::Currency::withdraw(
who,
fee,
WithdrawReason::TransactionPayment,
if tip.is_zero() {
WithdrawReason::TransactionPayment.into()
} else {
WithdrawReason::TransactionPayment | WithdrawReason::Tip
},
ExistenceRequirement::KeepAlive,
) {
Ok(imbalance) => imbalance,