Migrate pallet-transaction-payment to new pallet attribute macro (#9087)

* Migrate pallet-transaciont-payment to new pallet attribute macro

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* remove generic from genesis config

* fix test

* fix tests

* fix deprecated

* fix tests

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
Qinxuan Chen
2021-06-25 11:23:36 +08:00
committed by GitHub
parent 20347c2edb
commit bc0520913d
16 changed files with 187 additions and 130 deletions
+4 -2
View File
@@ -26,7 +26,7 @@ macro_rules! decl_tests {
use crate::*;
use sp_runtime::{ArithmeticError, FixedPointNumber, traits::{SignedExtension, BadOrigin}};
use frame_support::{
assert_noop, assert_storage_noop, assert_ok, assert_err, StorageValue,
assert_noop, assert_storage_noop, assert_ok, assert_err,
traits::{
LockableCurrency, LockIdentifier, WithdrawReasons,
Currency, ReservableCurrency, ExistenceRequirement::AllowDeath
@@ -148,7 +148,9 @@ macro_rules! decl_tests {
.monied(true)
.build()
.execute_with(|| {
pallet_transaction_payment::NextFeeMultiplier::put(Multiplier::saturating_from_integer(1));
pallet_transaction_payment::NextFeeMultiplier::<$test>::put(
Multiplier::saturating_from_integer(1)
);
Balances::set_lock(ID_1, &1, 10, WithdrawReasons::RESERVE);
assert_noop!(
<Balances as Currency<_>>::transfer(&1, &2, 1, AllowDeath),
@@ -43,6 +43,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},
}
);
@@ -45,6 +45,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},
}
);