Introduce WeightToFee trait instead of WeightToFeePolynomial and make WeightToFeePolynomial implement it instead (#11415)

* Introduce `WeightToFee` trait instead of `WeightToFeePolynomial` and make `WeightToFeePolynomial` implement it instead

* Rename `WeightToFee::calc()` to `WeightToFee::wight_to_fee()`

* Fix typo
This commit is contained in:
Nazar Mokrynskyi
2022-05-25 08:32:11 +03:00
committed by GitHub
parent 29474f9893
commit 0c25a2ee40
9 changed files with 86 additions and 112 deletions
+5 -5
View File
@@ -576,9 +576,7 @@ mod tests {
ConstU32, ConstU64, ConstU8, Currency, LockIdentifier, LockableCurrency,
WithdrawReasons,
},
weights::{
ConstantMultiplier, IdentityFee, RuntimeDbWeight, Weight, WeightToFeePolynomial,
},
weights::{ConstantMultiplier, IdentityFee, RuntimeDbWeight, Weight, WeightToFee},
};
use frame_system::{Call as SystemCall, ChainContext, LastRuntimeUpgradeInfo};
use pallet_balances::Call as BalancesCall;
@@ -866,7 +864,7 @@ mod tests {
.get(DispatchClass::Normal)
.base_extrinsic;
let fee: Balance =
<Runtime as pallet_transaction_payment::Config>::WeightToFee::calc(&weight);
<Runtime as pallet_transaction_payment::Config>::WeightToFee::weight_to_fee(&weight);
let mut t = sp_io::TestExternalities::new(t);
t.execute_with(|| {
Executive::initialize_block(&Header::new(
@@ -1153,7 +1151,9 @@ mod tests {
.get(DispatchClass::Normal)
.base_extrinsic;
let fee: Balance =
<Runtime as pallet_transaction_payment::Config>::WeightToFee::calc(&weight);
<Runtime as pallet_transaction_payment::Config>::WeightToFee::weight_to_fee(
&weight,
);
Executive::initialize_block(&Header::new(
1,
H256::default(),