Apply WeightToFeePolynomials to pallet_transaction_payment's length fee (#10785)

* Apply WeightToFeePolynomials to length fee

* Remove TransactionByteFee

* Add test cases for ConstantModifierFee

* Restore import

* Use pallet::constant_name

* Remove irrelevant TODO comment

* Update frame/support/src/weights.rs

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

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

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

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* s/ConstantModifierFee/ConstantMultiplier/

* Impl LengthToFee for test configs

* fmt

* Remove unused import

* Impl WeightToFeePolynomial for byte fee in ExtBuilder

* Remove unused import

* fix doc

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Stephen Shelton
2022-04-07 11:24:59 +00:00
committed by GitHub
parent b438b47f1a
commit ca1261ee21
10 changed files with 85 additions and 33 deletions
+4 -2
View File
@@ -576,7 +576,9 @@ mod tests {
ConstU32, ConstU64, ConstU8, Currency, LockIdentifier, LockableCurrency,
WithdrawReasons,
},
weights::{IdentityFee, RuntimeDbWeight, Weight, WeightToFeePolynomial},
weights::{
ConstantMultiplier, IdentityFee, RuntimeDbWeight, Weight, WeightToFeePolynomial,
},
};
use frame_system::{Call as SystemCall, ChainContext, LastRuntimeUpgradeInfo};
use pallet_balances::Call as BalancesCall;
@@ -787,9 +789,9 @@ mod tests {
}
impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, ()>;
type TransactionByteFee = TransactionByteFee;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = IdentityFee<Balance>;
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
type FeeMultiplierUpdate = ();
}
impl custom::Config for Runtime {}