From 601d52cdd4d9d195b6093397517bc0a9185d290f Mon Sep 17 00:00:00 2001 From: hzy1919 Date: Wed, 8 Jun 2022 00:56:59 +0800 Subject: [PATCH 01/11] add Event to Pallet Transaction Payment --- bin/node-template/runtime/src/lib.rs | 1 + bin/node/runtime/src/lib.rs | 1 + frame/transaction-payment/src/lib.rs | 24 +++++++++++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index 0145cacef8f7d..c514cdf6c25fd 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -249,6 +249,7 @@ impl pallet_balances::Config for Runtime { } impl pallet_transaction_payment::Config for Runtime { + type Event = Event; type OnChargeTransaction = CurrencyAdapter; type OperationalFeeMultiplier = ConstU8<5>; type WeightToFee = IdentityFee; diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs index b421a4f05ed1a..cda129a66325c 100644 --- a/bin/node/runtime/src/lib.rs +++ b/bin/node/runtime/src/lib.rs @@ -445,6 +445,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { + type Event = Event; type OnChargeTransaction = CurrencyAdapter; type OperationalFeeMultiplier = OperationalFeeMultiplier; type WeightToFee = IdentityFee; diff --git a/frame/transaction-payment/src/lib.rs b/frame/transaction-payment/src/lib.rs index d44f8b1b894e1..c9fe809c34712 100644 --- a/frame/transaction-payment/src/lib.rs +++ b/frame/transaction-payment/src/lib.rs @@ -249,6 +249,9 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { + /// The overarching event type. + type Event: From> + IsType<::Event>; + /// Handler for withdrawing, refunding and depositing the transaction fee. /// Transaction fees are withdrawn before the transaction is executed. /// After the transaction was executed the transaction weight can be @@ -321,6 +324,13 @@ pub mod pallet { } } + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// A transaction has been paid. + TransactionPaid { who: T::AccountId, fee: BalanceOf, tip: BalanceOf }, + } + #[pallet::hooks] impl Hooks> for Pallet { fn on_finalize(_: T::BlockNumber) { @@ -734,6 +744,7 @@ where T::OnChargeTransaction::correct_and_deposit_fee( &who, info, post_info, actual_fee, tip, imbalance, )?; + Pallet::::deposit_event(Event::::TransactionPaid { who, fee: actual_fee, tip }); } Ok(()) } @@ -790,7 +801,7 @@ mod tests { { System: system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, } ); @@ -899,6 +910,7 @@ mod tests { } impl Config for Runtime { + type Event = Event; type OnChargeTransaction = CurrencyAdapter; type OperationalFeeMultiplier = OperationalFeeMultiplier; type WeightToFee = WeightToFee; @@ -1407,8 +1419,14 @@ mod tests { &Ok(()) )); assert_eq!(Balances::total_balance(&user), 0); - // No events for such a scenario - assert_eq!(System::events().len(), 0); + // TransactionPaid Event + System::assert_has_event(Event::TransactionPayment( + pallet_transaction_payment::Event::TransactionPaid { + who: user, + fee: 0, + tip: 0, + }, + )); }); } From 6a4900aed735c7c3b74fdfbc57fcaefaeb6724b8 Mon Sep 17 00:00:00 2001 From: hzy1919 Date: Wed, 8 Jun 2022 09:29:45 +0800 Subject: [PATCH 02/11] Fix tests in Pallet Balance --- frame/balances/src/tests_composite.rs | 3 ++- frame/balances/src/tests_local.rs | 3 ++- frame/balances/src/tests_reentrancy.rs | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frame/balances/src/tests_composite.rs b/frame/balances/src/tests_composite.rs index 4a2cc1d91936d..4ab913cf1411a 100644 --- a/frame/balances/src/tests_composite.rs +++ b/frame/balances/src/tests_composite.rs @@ -40,7 +40,7 @@ frame_support::construct_runtime!( { System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, } ); @@ -77,6 +77,7 @@ impl frame_system::Config for Test { } impl pallet_transaction_payment::Config for Test { + type Event = Event; type OnChargeTransaction = CurrencyAdapter, ()>; type OperationalFeeMultiplier = ConstU8<5>; type WeightToFee = IdentityFee; diff --git a/frame/balances/src/tests_local.rs b/frame/balances/src/tests_local.rs index cfc7f84ab3a38..6f4c50d90153a 100644 --- a/frame/balances/src/tests_local.rs +++ b/frame/balances/src/tests_local.rs @@ -41,7 +41,7 @@ frame_support::construct_runtime!( { System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, } ); @@ -78,6 +78,7 @@ impl frame_system::Config for Test { } impl pallet_transaction_payment::Config for Test { + type Event = Event; type OnChargeTransaction = CurrencyAdapter, ()>; type OperationalFeeMultiplier = ConstU8<5>; type WeightToFee = IdentityFee; diff --git a/frame/balances/src/tests_reentrancy.rs b/frame/balances/src/tests_reentrancy.rs index 7037e9615afd8..e912956d1e7e3 100644 --- a/frame/balances/src/tests_reentrancy.rs +++ b/frame/balances/src/tests_reentrancy.rs @@ -84,6 +84,7 @@ impl frame_system::Config for Test { } impl pallet_transaction_payment::Config for Test { + type Event = Event; type OnChargeTransaction = CurrencyAdapter, ()>; type OperationalFeeMultiplier = ConstU8<5>; type WeightToFee = IdentityFee; From 91c8dd012ef8eaa55924d51c75e2bab666c33440 Mon Sep 17 00:00:00 2001 From: hzy1919 Date: Wed, 8 Jun 2022 16:23:35 +0800 Subject: [PATCH 03/11] Fix tests in Pallet Balance/Executive/Asset-tx-payment. --- frame/balances/src/lib.rs | 1 + frame/balances/src/tests_reentrancy.rs | 15 ++------------- frame/executive/src/lib.rs | 3 ++- .../asset-tx-payment/src/tests.rs | 3 ++- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/frame/balances/src/lib.rs b/frame/balances/src/lib.rs index 7060486f8584d..850f8d2ccf097 100644 --- a/frame/balances/src/lib.rs +++ b/frame/balances/src/lib.rs @@ -158,6 +158,7 @@ mod tests; mod benchmarking; mod tests_composite; mod tests_local; +#[cfg(test)] mod tests_reentrancy; pub mod weights; diff --git a/frame/balances/src/tests_reentrancy.rs b/frame/balances/src/tests_reentrancy.rs index e912956d1e7e3..4c028840d553c 100644 --- a/frame/balances/src/tests_reentrancy.rs +++ b/frame/balances/src/tests_reentrancy.rs @@ -19,13 +19,11 @@ #![cfg(test)] -use crate::{self as pallet_balances, Config, Pallet}; +use crate::{self as pallet_balances, Config}; use frame_support::{ parameter_types, - traits::{ConstU32, ConstU64, ConstU8, StorageMapShim}, - weights::IdentityFee, + traits::{ConstU32, ConstU64, StorageMapShim}, }; -use pallet_transaction_payment::CurrencyAdapter; use sp_core::H256; use sp_io; use sp_runtime::{testing::Header, traits::IdentityLookup}; @@ -83,15 +81,6 @@ impl frame_system::Config for Test { type MaxConsumers = frame_support::traits::ConstU32<16>; } -impl pallet_transaction_payment::Config for Test { - type Event = Event; - type OnChargeTransaction = CurrencyAdapter, ()>; - type OperationalFeeMultiplier = ConstU8<5>; - type WeightToFee = IdentityFee; - type LengthToFee = IdentityFee; - type FeeMultiplierUpdate = (); -} - pub struct OnDustRemoval; impl OnUnbalanced> for OnDustRemoval { fn on_nonzero_unbalanced(amount: NegativeImbalance) { diff --git a/frame/executive/src/lib.rs b/frame/executive/src/lib.rs index 55b7e926a0fad..60bf0a47ca120 100644 --- a/frame/executive/src/lib.rs +++ b/frame/executive/src/lib.rs @@ -722,7 +722,7 @@ mod tests { { System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, Custom: custom::{Pallet, Call, ValidateUnsigned, Inherent}, } ); @@ -783,6 +783,7 @@ mod tests { pub const TransactionByteFee: Balance = 0; } impl pallet_transaction_payment::Config for Runtime { + type Event = Event; type OnChargeTransaction = CurrencyAdapter; type OperationalFeeMultiplier = ConstU8<5>; type WeightToFee = IdentityFee; diff --git a/frame/transaction-payment/asset-tx-payment/src/tests.rs b/frame/transaction-payment/asset-tx-payment/src/tests.rs index 5b1fa157c3f10..ad5bc3f22e57f 100644 --- a/frame/transaction-payment/asset-tx-payment/src/tests.rs +++ b/frame/transaction-payment/asset-tx-payment/src/tests.rs @@ -48,7 +48,7 @@ frame_support::construct_runtime!( { System: system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, Assets: pallet_assets::{Pallet, Call, Storage, Event}, Authorship: pallet_authorship::{Pallet, Call, Storage}, AssetTxPayment: pallet_asset_tx_payment::{Pallet}, @@ -143,6 +143,7 @@ impl WeightToFeeT for TransactionByteFee { } impl pallet_transaction_payment::Config for Runtime { + type Event = Event; type OnChargeTransaction = CurrencyAdapter; type WeightToFee = WeightToFee; type LengthToFee = TransactionByteFee; From 7efbc90bc47599dbd42567a1b4d1d3a63b89f070 Mon Sep 17 00:00:00 2001 From: hzy1919 Date: Thu, 9 Jun 2022 11:38:58 +0800 Subject: [PATCH 04/11] Fix --- bin/node/bench/src/import.rs | 7 ++++--- bin/node/executor/tests/basic.rs | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/node/bench/src/import.rs b/bin/node/bench/src/import.rs index faba85468b1fa..b9229fbd5331d 100644 --- a/bin/node/bench/src/import.rs +++ b/bin/node/bench/src/import.rs @@ -135,9 +135,10 @@ impl core::Benchmark for ImportBenchmark { .inspect_state(|| { match self.block_type { BlockType::RandomTransfersKeepAlive => { - // should be 7 per signed extrinsic + 1 per unsigned + // should be 8 per signed extrinsic + 1 per unsigned // we have 1 unsigned and the rest are signed in the block - // those 7 events per signed are: + // those 8 events per signed are: + // - transaction paid for the transaction payment // - withdraw (Balances::Withdraw) for charging the transaction fee // - new account (System::NewAccount) as we always transfer fund to // non-existent account @@ -148,7 +149,7 @@ impl core::Benchmark for ImportBenchmark { // - extrinsic success assert_eq!( node_runtime::System::events().len(), - (self.block.extrinsics.len() - 1) * 7 + 1, + (self.block.extrinsics.len() - 1) * 8 + 1, ); }, BlockType::Noop => { diff --git a/bin/node/executor/tests/basic.rs b/bin/node/executor/tests/basic.rs index da0f4e6afb319..61e4da0a1e808 100644 --- a/bin/node/executor/tests/basic.rs +++ b/bin/node/executor/tests/basic.rs @@ -417,6 +417,15 @@ fn full_native_block_import_works() { event: Event::Treasury(pallet_treasury::Event::Deposit { value: fees * 8 / 10 }), topics: vec![], }, + EventRecord { + phase: Phase::ApplyExtrinsic(1), + event: Event::TransactionPayment(Event::TransactionPaid { + who: alice().into(), + fee: fees, + tip: 0, + }), + topics: vec![], + }, EventRecord { phase: Phase::ApplyExtrinsic(1), event: Event::System(frame_system::Event::ExtrinsicSuccess { From dc075eaba279859ceb04f4370ed7d64a71d16d55 Mon Sep 17 00:00:00 2001 From: hzy1919 Date: Thu, 9 Jun 2022 11:54:34 +0800 Subject: [PATCH 05/11] fmt --- bin/node/executor/tests/basic.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/node/executor/tests/basic.rs b/bin/node/executor/tests/basic.rs index 61e4da0a1e808..0943595ecc285 100644 --- a/bin/node/executor/tests/basic.rs +++ b/bin/node/executor/tests/basic.rs @@ -417,13 +417,13 @@ fn full_native_block_import_works() { event: Event::Treasury(pallet_treasury::Event::Deposit { value: fees * 8 / 10 }), topics: vec![], }, - EventRecord { - phase: Phase::ApplyExtrinsic(1), - event: Event::TransactionPayment(Event::TransactionPaid { - who: alice().into(), - fee: fees, + EventRecord { + phase: Phase::ApplyExtrinsic(1), + event: Event::TransactionPayment(Event::TransactionPaid { + who: alice().into(), + fee: fees, tip: 0, - }), + }), topics: vec![], }, EventRecord { From bf2c93ec78cde644b3880be86d334fc24f60b836 Mon Sep 17 00:00:00 2001 From: hzy1919 Date: Thu, 9 Jun 2022 15:11:27 +0800 Subject: [PATCH 06/11] Fix --- bin/node/executor/tests/basic.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/node/executor/tests/basic.rs b/bin/node/executor/tests/basic.rs index 0943595ecc285..354e8d57e02a9 100644 --- a/bin/node/executor/tests/basic.rs +++ b/bin/node/executor/tests/basic.rs @@ -419,11 +419,13 @@ fn full_native_block_import_works() { }, EventRecord { phase: Phase::ApplyExtrinsic(1), - event: Event::TransactionPayment(Event::TransactionPaid { - who: alice().into(), - fee: fees, - tip: 0, - }), + event: Event::TransactionPayment( + pallet_transaction_payment::Event::TransactionPaid { + who: alice().into(), + fee: fees, + tip: 0, + }, + ), topics: vec![], }, EventRecord { From 150534b2970523eeba4d1ffd4a543130128c1327 Mon Sep 17 00:00:00 2001 From: HuangZY Date: Thu, 9 Jun 2022 22:52:37 +0800 Subject: [PATCH 07/11] Fix --- bin/node/executor/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/node/executor/Cargo.toml b/bin/node/executor/Cargo.toml index 6b6a1709d5aa0..5fbf59a74fdcd 100644 --- a/bin/node/executor/Cargo.toml +++ b/bin/node/executor/Cargo.toml @@ -36,6 +36,7 @@ pallet-contracts = { version = "4.0.0-dev", path = "../../../frame/contracts" } pallet-im-online = { version = "4.0.0-dev", path = "../../../frame/im-online" } pallet-timestamp = { version = "4.0.0-dev", path = "../../../frame/timestamp" } pallet-treasury = { version = "4.0.0-dev", path = "../../../frame/treasury" } +pallet-transaction-payment = { version = "4.0.0-dev", path = "../../../frame/transaction-payment" } sp-application-crypto = { version = "6.0.0", path = "../../../primitives/application-crypto" } sp-consensus-babe = { version = "0.10.0-dev", path = "../../../primitives/consensus/babe" } sp-externalities = { version = "0.12.0", path = "../../../primitives/externalities" } From c85df72cb82931a47f3fba6b16878f866ed68f3d Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 11 Jun 2022 15:20:44 +0100 Subject: [PATCH 08/11] Update Cargo.lock --- Cargo.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.lock b/Cargo.lock index 42accdb455cef..cc6a1d41c13d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4650,6 +4650,7 @@ dependencies = [ "pallet-contracts", "pallet-im-online", "pallet-timestamp", + "pallet-transaction-payment", "pallet-treasury", "parity-scale-codec", "sc-executor", From a9b7b9a4826af2e6a412e3213242ad1d2c30e78f Mon Sep 17 00:00:00 2001 From: Huang ZY Date: Sun, 12 Jun 2022 22:30:58 +0800 Subject: [PATCH 09/11] Fix tests in executor --- bin/node/executor/tests/basic.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bin/node/executor/tests/basic.rs b/bin/node/executor/tests/basic.rs index 354e8d57e02a9..3ad7937001132 100644 --- a/bin/node/executor/tests/basic.rs +++ b/bin/node/executor/tests/basic.rs @@ -499,6 +499,17 @@ fn full_native_block_import_works() { event: Event::Treasury(pallet_treasury::Event::Deposit { value: fees * 8 / 10 }), topics: vec![], }, + EventRecord { + phase: Phase::ApplyExtrinsic(1), + event: Event::TransactionPayment( + pallet_transaction_payment::Event::TransactionPaid { + who: bob().into(), + fee: fees, + tip: 0, + }, + ), + topics: vec![], + }, EventRecord { phase: Phase::ApplyExtrinsic(1), event: Event::System(frame_system::Event::ExtrinsicSuccess { @@ -536,6 +547,17 @@ fn full_native_block_import_works() { event: Event::Treasury(pallet_treasury::Event::Deposit { value: fees * 8 / 10 }), topics: vec![], }, + EventRecord { + phase: Phase::ApplyExtrinsic(2), + event: Event::TransactionPayment( + pallet_transaction_payment::Event::TransactionPaid { + who: alice().into(), + fee: fees, + tip: 0, + }, + ), + topics: vec![], + }, EventRecord { phase: Phase::ApplyExtrinsic(2), event: Event::System(frame_system::Event::ExtrinsicSuccess { From fce0bf9a756ae16ba066ebadb8acc83ec8965dc3 Mon Sep 17 00:00:00 2001 From: ZhiYong Date: Tue, 14 Jun 2022 19:32:55 +0800 Subject: [PATCH 10/11] Update frame/transaction-payment/src/lib.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> --- 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 c9fe809c34712..3ffe1c6c3261b 100644 --- a/frame/transaction-payment/src/lib.rs +++ b/frame/transaction-payment/src/lib.rs @@ -327,8 +327,8 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// A transaction has been paid. - TransactionPaid { who: T::AccountId, fee: BalanceOf, tip: BalanceOf }, + /// A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee, has been paid by `who`. + TransactionFeePaid { who: T::AccountId, actual_fee: BalanceOf, tip: BalanceOf }, } #[pallet::hooks] From 4a35698733e6e555ca36a04805c28c1bcf8bc4e3 Mon Sep 17 00:00:00 2001 From: Huang ZY Date: Tue, 14 Jun 2022 22:01:08 +0800 Subject: [PATCH 11/11] update the name of the event and fmt. --- bin/node/executor/tests/basic.rs | 12 ++++++------ client/db/src/parity_db.rs | 5 +++-- frame/transaction-payment/src/lib.rs | 11 ++++++----- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/bin/node/executor/tests/basic.rs b/bin/node/executor/tests/basic.rs index 3ad7937001132..de2aa6c18369d 100644 --- a/bin/node/executor/tests/basic.rs +++ b/bin/node/executor/tests/basic.rs @@ -420,9 +420,9 @@ fn full_native_block_import_works() { EventRecord { phase: Phase::ApplyExtrinsic(1), event: Event::TransactionPayment( - pallet_transaction_payment::Event::TransactionPaid { + pallet_transaction_payment::Event::TransactionFeePaid { who: alice().into(), - fee: fees, + actual_fee: fees, tip: 0, }, ), @@ -502,9 +502,9 @@ fn full_native_block_import_works() { EventRecord { phase: Phase::ApplyExtrinsic(1), event: Event::TransactionPayment( - pallet_transaction_payment::Event::TransactionPaid { + pallet_transaction_payment::Event::TransactionFeePaid { who: bob().into(), - fee: fees, + actual_fee: fees, tip: 0, }, ), @@ -550,9 +550,9 @@ fn full_native_block_import_works() { EventRecord { phase: Phase::ApplyExtrinsic(2), event: Event::TransactionPayment( - pallet_transaction_payment::Event::TransactionPaid { + pallet_transaction_payment::Event::TransactionFeePaid { who: alice().into(), - fee: fees, + actual_fee: fees, tip: 0, }, ), diff --git a/client/db/src/parity_db.rs b/client/db/src/parity_db.rs index 7ce1d6a683401..4adacbf6f041c 100644 --- a/client/db/src/parity_db.rs +++ b/client/db/src/parity_db.rs @@ -106,7 +106,7 @@ impl> Database for DbAdapter { } return None }, - Change::Reference(col, key) => + Change::Reference(col, key) => { if ref_counted_column(col) { // FIXME accessing value is not strictly needed, optimize this in parity-db. let value = >::get(self, col, key.as_ref()); @@ -116,7 +116,8 @@ impl> Database for DbAdapter { not_ref_counted_column.push(col); } return None - }, + } + }, Change::Release(col, key) => if ref_counted_column(col) { (col as u8, key.as_ref().to_vec(), None) diff --git a/frame/transaction-payment/src/lib.rs b/frame/transaction-payment/src/lib.rs index 3ffe1c6c3261b..0f5c0321130be 100644 --- a/frame/transaction-payment/src/lib.rs +++ b/frame/transaction-payment/src/lib.rs @@ -327,7 +327,8 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee, has been paid by `who`. + /// A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee, + /// has been paid by `who`. TransactionFeePaid { who: T::AccountId, actual_fee: BalanceOf, tip: BalanceOf }, } @@ -744,7 +745,7 @@ where T::OnChargeTransaction::correct_and_deposit_fee( &who, info, post_info, actual_fee, tip, imbalance, )?; - Pallet::::deposit_event(Event::::TransactionPaid { who, fee: actual_fee, tip }); + Pallet::::deposit_event(Event::::TransactionFeePaid { who, actual_fee, tip }); } Ok(()) } @@ -1419,11 +1420,11 @@ mod tests { &Ok(()) )); assert_eq!(Balances::total_balance(&user), 0); - // TransactionPaid Event + // TransactionFeePaid Event System::assert_has_event(Event::TransactionPayment( - pallet_transaction_payment::Event::TransactionPaid { + pallet_transaction_payment::Event::TransactionFeePaid { who: user, - fee: 0, + actual_fee: 0, tip: 0, }, ));