Add Event to Pallet Transaction Payment (#11618)

* add Event to Pallet Transaction Payment

* Fix tests in Pallet Balance

* Fix tests in Pallet Balance/Executive/Asset-tx-payment.

* Fix

* fmt

* Fix

* Fix

* Update Cargo.lock

* Fix tests in executor

* Update frame/transaction-payment/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* update the name of the event and fmt.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This commit is contained in:
ZhiYong
2022-06-16 09:30:49 +08:00
committed by GitHub
parent b71e180446
commit e252c274c1
14 changed files with 77 additions and 24 deletions
+1
View File
@@ -158,6 +158,7 @@ mod tests;
mod benchmarking;
mod tests_composite;
mod tests_local;
#[cfg(test)]
mod tests_reentrancy;
pub mod weights;
@@ -40,7 +40,7 @@ frame_support::construct_runtime!(
{
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>},
}
);
@@ -77,6 +77,7 @@ impl frame_system::Config for Test {
}
impl pallet_transaction_payment::Config for Test {
type Event = Event;
type OnChargeTransaction = CurrencyAdapter<Pallet<Test>, ()>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = IdentityFee<u64>;
+2 -1
View File
@@ -41,7 +41,7 @@ frame_support::construct_runtime!(
{
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>},
}
);
@@ -78,6 +78,7 @@ impl frame_system::Config for Test {
}
impl pallet_transaction_payment::Config for Test {
type Event = Event;
type OnChargeTransaction = CurrencyAdapter<Pallet<Test>, ()>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = IdentityFee<u64>;
@@ -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,14 +81,6 @@ impl frame_system::Config for Test {
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
impl pallet_transaction_payment::Config for Test {
type OnChargeTransaction = CurrencyAdapter<Pallet<Test>, ()>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = IdentityFee<u64>;
type LengthToFee = IdentityFee<u64>;
type FeeMultiplierUpdate = ();
}
pub struct OnDustRemoval;
impl OnUnbalanced<NegativeImbalance<Test>> for OnDustRemoval {
fn on_nonzero_unbalanced(amount: NegativeImbalance<Test>) {