mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 14:31:13 +00:00
refactor: Transaction-Payment module (#3816)
* Initial draft that compiles * Extract payment stuff from balances * Extract multiplier update stuff from system * Some fixes. * Update len-fee as well * some review comments. * Remove todo * bump
This commit is contained in:
@@ -442,7 +442,7 @@ where
|
||||
}
|
||||
|
||||
/// The default dispatch fee computor computes the fee in the same way that
|
||||
/// the implementation of `TakeFees` for the Balances module does. Note that this only takes a fixed
|
||||
/// the implementation of `ChargeTransactionPayment` for the Balances module does. Note that this only takes a fixed
|
||||
/// fee based on size. Unlike the balances module, weight-fee is applied.
|
||||
pub struct DefaultDispatchFeeComputor<T: Trait>(PhantomData<T>);
|
||||
impl<T: Trait> ComputeDispatchFee<<T as Trait>::Call, BalanceOf<T>> for DefaultDispatchFeeComputor<T> {
|
||||
|
||||
@@ -96,8 +96,6 @@ parameter_types! {
|
||||
pub const BlockHashCount: u64 = 250;
|
||||
pub const MaximumBlockWeight: u32 = 1024;
|
||||
pub const MaximumBlockLength: u32 = 2 * 1024;
|
||||
pub const BalancesTransactionBaseFee: u64 = 0;
|
||||
pub const BalancesTransactionByteFee: u64 = 0;
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::one();
|
||||
}
|
||||
impl system::Trait for Test {
|
||||
@@ -110,7 +108,6 @@ impl system::Trait for Test {
|
||||
type AccountId = u64;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type WeightMultiplierUpdate = ();
|
||||
type Event = MetaEvent;
|
||||
type BlockHashCount = BlockHashCount;
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
@@ -123,15 +120,11 @@ impl balances::Trait for Test {
|
||||
type OnFreeBalanceZero = Contract;
|
||||
type OnNewAccount = ();
|
||||
type Event = MetaEvent;
|
||||
type TransactionPayment = ();
|
||||
type DustRemoval = ();
|
||||
type TransferPayment = ();
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type TransferFee = TransferFee;
|
||||
type CreationFee = CreationFee;
|
||||
type TransactionBaseFee = BalancesTransactionBaseFee;
|
||||
type TransactionByteFee = BalancesTransactionByteFee;
|
||||
type WeightToFee = ();
|
||||
}
|
||||
parameter_types! {
|
||||
pub const MinimumPeriod: u64 = 1;
|
||||
|
||||
Reference in New Issue
Block a user