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
@@ -1,16 +1,19 @@
///! Traits and default implementation for paying transaction fees.
use crate::Config;
use codec::FullCodec;
use frame_support::{
traits::{Currency, ExistenceRequirement, Get, Imbalance, OnUnbalanced, WithdrawReasons},
unsigned::TransactionValidityError,
};
use sp_runtime::{
traits::{AtLeast32BitUnsigned, DispatchInfoOf, MaybeSerializeDeserialize, PostDispatchInfoOf, Saturating, Zero},
transaction_validity::InvalidTransaction,
};
use sp_std::{fmt::Debug, marker::PhantomData};
use frame_support::{
traits::{Currency, ExistenceRequirement, Get, Imbalance, OnUnbalanced, WithdrawReasons},
unsigned::TransactionValidityError,
};
type NegativeImbalanceOf<C, T> =
<C as Currency<<T as frame_system::Config>::AccountId>>::NegativeImbalance;
@@ -47,7 +50,7 @@ pub trait OnChargeTransaction<T: Config> {
) -> Result<(), TransactionValidityError>;
}
/// Implements the transaction payment for a module implementing the `Currency`
/// Implements the transaction payment for a pallet implementing the `Currency`
/// trait (eg. the pallet_balances) using an unbalance handler (implementing
/// `OnUnbalanced`).
///