mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 06:27:58 +00:00
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:
@@ -18,9 +18,7 @@
|
||||
use codec::{Encode, Joiner};
|
||||
use frame_support::{
|
||||
traits::Currency,
|
||||
weights::{
|
||||
constants::ExtrinsicBaseWeight, GetDispatchInfo, IdentityFee, WeightToFeePolynomial,
|
||||
},
|
||||
weights::{constants::ExtrinsicBaseWeight, GetDispatchInfo, IdentityFee, WeightToFee},
|
||||
};
|
||||
use node_primitives::Balance;
|
||||
use node_runtime::{
|
||||
@@ -197,13 +195,13 @@ fn transaction_fee_is_correct() {
|
||||
let mut balance_alice = (100 - 69) * DOLLARS;
|
||||
|
||||
let base_weight = ExtrinsicBaseWeight::get();
|
||||
let base_fee = IdentityFee::<Balance>::calc(&base_weight);
|
||||
let base_fee = IdentityFee::<Balance>::weight_to_fee(&base_weight);
|
||||
|
||||
let length_fee = TransactionByteFee::get() * (xt.clone().encode().len() as Balance);
|
||||
balance_alice -= length_fee;
|
||||
|
||||
let weight = default_transfer_call().get_dispatch_info().weight;
|
||||
let weight_fee = IdentityFee::<Balance>::calc(&weight);
|
||||
let weight_fee = IdentityFee::<Balance>::weight_to_fee(&weight);
|
||||
|
||||
// we know that weight to fee multiplier is effect-less in block 1.
|
||||
// current weight of transfer = 200_000_000
|
||||
|
||||
Reference in New Issue
Block a user