From 8f10ac545f07678dbd1d283d56a7fe15fde4c503 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Mon, 28 Jun 2021 09:19:48 -0400 Subject: [PATCH 1/2] Add public accessor for tip amount. --- frame/transaction-payment/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frame/transaction-payment/src/lib.rs b/frame/transaction-payment/src/lib.rs index af1fcc5bfeaaa..8f1d510cf55bc 100644 --- a/frame/transaction-payment/src/lib.rs +++ b/frame/transaction-payment/src/lib.rs @@ -525,6 +525,11 @@ impl ChargeTransactionPayment where Self(fee) } + /// Public accessor to get the amount of the tip that will be applied. + pub fn tip_amount(&self) -> BalanceOf { + self.0 + } + fn withdraw_fee( &self, who: &T::AccountId, From 386036273ee72e8fa49d54202bc10b3e9dd403aa Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Mon, 28 Jun 2021 09:28:26 -0400 Subject: [PATCH 2/2] Update frame/transaction-payment/src/lib.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bastian Köcher --- frame/transaction-payment/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frame/transaction-payment/src/lib.rs b/frame/transaction-payment/src/lib.rs index 8f1d510cf55bc..416439e7f200c 100644 --- a/frame/transaction-payment/src/lib.rs +++ b/frame/transaction-payment/src/lib.rs @@ -525,8 +525,8 @@ impl ChargeTransactionPayment where Self(fee) } - /// Public accessor to get the amount of the tip that will be applied. - pub fn tip_amount(&self) -> BalanceOf { + /// Returns the tip as being choosen by the transaction sender. + pub fn tip(&self) -> BalanceOf { self.0 }