From 0f36368225a521e33e4fd73a0759d15f03d8d73e Mon Sep 17 00:00:00 2001 From: MrishoLukamba Date: Sat, 5 Aug 2023 02:16:38 +0300 Subject: [PATCH] ext fees inclusion on tip --- frame/transaction-payment/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frame/transaction-payment/src/lib.rs b/frame/transaction-payment/src/lib.rs index 8160d72ad8942..482f509521261 100644 --- a/frame/transaction-payment/src/lib.rs +++ b/frame/transaction-payment/src/lib.rs @@ -759,7 +759,11 @@ where match info.class { DispatchClass::Normal => { // For normal class we simply take the `tip_per_weight`. - scaled_tip + let fee_n_multiplier = T::OperationalFeeMultiplier::get() + .saturated_into::>().saturating_mul(final_fee); + // Taking into account extrinsic fee + // final_tip = multiplier * final_fee + scaled_tip + scaled_tip.saturating_add(fee_n_multiplier) }, DispatchClass::Mandatory => { // Mandatory extrinsics should be prohibited (e.g. by the [`CheckWeight`]