mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 23:21:02 +00:00
* Companion for https://github.com/paritytech/substrate/pull/11415 * Rename `WeightToFee::calc()` to `WeightToFee::wight_to_fee()` * Fix typo * Fix compile errors * update lockfile for {"substrate"} Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -343,7 +343,7 @@ mod tests {
|
||||
let bridge = MILLAU_CHAIN_ID;
|
||||
let call: Call = SystemCall::set_heap_pages { pages: 64 }.into();
|
||||
let dispatch_weight = call.get_dispatch_info().weight;
|
||||
let dispatch_fee = <Runtime as pallet_transaction_payment::Config>::WeightToFee::calc(
|
||||
let dispatch_fee = <Runtime as pallet_transaction_payment::Config>::WeightToFee::weight_to_fee(
|
||||
&dispatch_weight,
|
||||
);
|
||||
assert!(dispatch_fee > 0);
|
||||
@@ -508,7 +508,7 @@ mod tests {
|
||||
}
|
||||
|
||||
let dispatch_weight = 500;
|
||||
let dispatch_fee = <Runtime as pallet_transaction_payment::Config>::WeightToFee::calc(
|
||||
let dispatch_fee = <Runtime as pallet_transaction_payment::Config>::WeightToFee::weight_to_fee(
|
||||
&dispatch_weight,
|
||||
);
|
||||
assert!(dispatch_fee > 0);
|
||||
|
||||
@@ -33,7 +33,7 @@ use bp_runtime::{
|
||||
use codec::{Decode, DecodeLimit, Encode};
|
||||
use frame_support::{
|
||||
traits::{Currency, ExistenceRequirement},
|
||||
weights::{Weight, WeightToFeePolynomial},
|
||||
weights::{Weight, WeightToFee},
|
||||
RuntimeDebug,
|
||||
};
|
||||
use hash_db::Hasher;
|
||||
@@ -598,7 +598,8 @@ pub mod target {
|
||||
message_id,
|
||||
message.data.payload.map_err(drop),
|
||||
|dispatch_origin, dispatch_weight| {
|
||||
let unadjusted_weight_fee = ThisRuntime::WeightToFee::calc(&dispatch_weight);
|
||||
let unadjusted_weight_fee =
|
||||
ThisRuntime::WeightToFee::weight_to_fee(&dispatch_weight);
|
||||
let fee_multiplier =
|
||||
pallet_transaction_payment::Pallet::<ThisRuntime>::next_fee_multiplier();
|
||||
let adjusted_weight_fee =
|
||||
|
||||
@@ -103,7 +103,7 @@ pub(crate) mod tests {
|
||||
// for simplicity - add extra weight for base tx fee + fee that is paid for the tx size +
|
||||
// adjusted fee
|
||||
let single_source_header_submit_tx_weight = single_source_header_submit_call_weight * 3 / 2;
|
||||
let single_source_header_tx_cost = W::calc(&single_source_header_submit_tx_weight);
|
||||
let single_source_header_tx_cost = W::weight_to_fee(&single_source_header_submit_tx_weight);
|
||||
single_source_header_tx_cost * B::from(expected_source_headers_per_day)
|
||||
}
|
||||
|
||||
|
||||
@@ -493,8 +493,8 @@ fn compute_fee_multiplier<C: Chain>(
|
||||
) -> FixedU128 {
|
||||
let adjusted_weight_fee_difference =
|
||||
larger_adjusted_weight_fee.saturating_sub(smaller_adjusted_weight_fee);
|
||||
let smaller_tx_unadjusted_weight_fee = WeightToFeeOf::<C>::calc(&smaller_tx_weight);
|
||||
let larger_tx_unadjusted_weight_fee = WeightToFeeOf::<C>::calc(&larger_tx_weight);
|
||||
let smaller_tx_unadjusted_weight_fee = WeightToFeeOf::<C>::weight_to_fee(&smaller_tx_weight);
|
||||
let larger_tx_unadjusted_weight_fee = WeightToFeeOf::<C>::weight_to_fee(&larger_tx_weight);
|
||||
FixedU128::saturating_from_rational(
|
||||
adjusted_weight_fee_difference,
|
||||
larger_tx_unadjusted_weight_fee.saturating_sub(smaller_tx_unadjusted_weight_fee),
|
||||
@@ -507,7 +507,7 @@ fn compute_prepaid_messages_refund<C: ChainWithMessages>(
|
||||
total_prepaid_nonces: MessageNonce,
|
||||
fee_multiplier: FixedU128,
|
||||
) -> BalanceOf<C> {
|
||||
fee_multiplier.saturating_mul_int(WeightToFeeOf::<C>::calc(
|
||||
fee_multiplier.saturating_mul_int(WeightToFeeOf::<C>::weight_to_fee(
|
||||
&C::PAY_INBOUND_DISPATCH_FEE_WEIGHT_AT_CHAIN.saturating_mul(total_prepaid_nonces),
|
||||
))
|
||||
}
|
||||
@@ -554,11 +554,11 @@ mod tests {
|
||||
|
||||
let smaller_weight = 1_000_000;
|
||||
let smaller_adjusted_weight_fee =
|
||||
multiplier.saturating_mul_int(WeightToFeeOf::<Rococo>::calc(&smaller_weight));
|
||||
multiplier.saturating_mul_int(WeightToFeeOf::<Rococo>::weight_to_fee(&smaller_weight));
|
||||
|
||||
let larger_weight = smaller_weight + 200_000;
|
||||
let larger_adjusted_weight_fee =
|
||||
multiplier.saturating_mul_int(WeightToFeeOf::<Rococo>::calc(&larger_weight));
|
||||
multiplier.saturating_mul_int(WeightToFeeOf::<Rococo>::weight_to_fee(&larger_weight));
|
||||
|
||||
assert_eq!(
|
||||
compute_fee_multiplier::<Rococo>(
|
||||
|
||||
Reference in New Issue
Block a user