mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Change a few fee/weight parameters (#2481)
* Change a few fee parameters * Update runtime/common/src/lib.rs
This commit is contained in:
@@ -1377,39 +1377,23 @@ mod test_fees {
|
||||
let len = call.using_encoded(|e| e.len()) as u32;
|
||||
|
||||
let mut ext = sp_io::TestExternalities::new_empty();
|
||||
ext.execute_with(|| {
|
||||
pallet_transaction_payment::NextFeeMultiplier::put(min_multiplier);
|
||||
let fee = TransactionPayment::compute_fee(len, &info, 0);
|
||||
println!(
|
||||
"weight = {:?} // multiplier = {:?} // full transfer fee = {:?}",
|
||||
info.weight.separated_string(),
|
||||
pallet_transaction_payment::NextFeeMultiplier::get(),
|
||||
fee.separated_string(),
|
||||
);
|
||||
});
|
||||
let mut test_with_multiplier = |m| {
|
||||
ext.execute_with(|| {
|
||||
pallet_transaction_payment::NextFeeMultiplier::put(m);
|
||||
let fee = TransactionPayment::compute_fee(len, &info, 0);
|
||||
println!(
|
||||
"weight = {:?} // multiplier = {:?} // full transfer fee = {:?}",
|
||||
info.weight.separated_string(),
|
||||
pallet_transaction_payment::NextFeeMultiplier::get(),
|
||||
fee.separated_string(),
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
ext.execute_with(|| {
|
||||
let mul = Multiplier::saturating_from_rational(1, 1000_000_000u128);
|
||||
pallet_transaction_payment::NextFeeMultiplier::put(mul);
|
||||
let fee = TransactionPayment::compute_fee(len, &info, 0);
|
||||
println!(
|
||||
"weight = {:?} // multiplier = {:?} // full transfer fee = {:?}",
|
||||
info.weight.separated_string(),
|
||||
pallet_transaction_payment::NextFeeMultiplier::get(),
|
||||
fee.separated_string(),
|
||||
);
|
||||
});
|
||||
|
||||
ext.execute_with(|| {
|
||||
let mul = Multiplier::saturating_from_rational(1, 1u128);
|
||||
pallet_transaction_payment::NextFeeMultiplier::put(mul);
|
||||
let fee = TransactionPayment::compute_fee(len, &info, 0);
|
||||
println!(
|
||||
"weight = {:?} // multiplier = {:?} // full transfer fee = {:?}",
|
||||
info.weight.separated_string(),
|
||||
pallet_transaction_payment::NextFeeMultiplier::get(),
|
||||
fee.separated_string(),
|
||||
);
|
||||
});
|
||||
test_with_multiplier(min_multiplier);
|
||||
test_with_multiplier(Multiplier::saturating_from_rational(1, 1u128));
|
||||
test_with_multiplier(Multiplier::saturating_from_rational(1, 1_000u128));
|
||||
test_with_multiplier(Multiplier::saturating_from_rational(1, 1_000_000u128));
|
||||
test_with_multiplier(Multiplier::saturating_from_rational(1, 1_000_000_000u128));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user