mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
@@ -2046,7 +2046,7 @@ mod tests_fess {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod multiplier_tests {
|
mod multiplier_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use frame_support::{dispatch::GetDispatchInfo, traits::OnFinalize};
|
use frame_support::{dispatch::DispatchInfo, traits::OnFinalize};
|
||||||
use runtime_common::{MinimumMultiplier, TargetBlockFullness};
|
use runtime_common::{MinimumMultiplier, TargetBlockFullness};
|
||||||
use separator::Separatable;
|
use separator::Separatable;
|
||||||
use sp_runtime::traits::Convert;
|
use sp_runtime::traits::Convert;
|
||||||
@@ -2088,17 +2088,8 @@ mod multiplier_tests {
|
|||||||
let mut blocks = 0;
|
let mut blocks = 0;
|
||||||
let mut fees_paid = 0;
|
let mut fees_paid = 0;
|
||||||
|
|
||||||
let call = frame_system::Call::<Runtime>::fill_block {
|
frame_system::Pallet::<Runtime>::set_block_consumed_resources(Weight::MAX, 0);
|
||||||
ratio: Perbill::from_rational(
|
let info = DispatchInfo { weight: Weight::MAX, ..Default::default() };
|
||||||
block_weight.ref_time(),
|
|
||||||
BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap().ref_time(),
|
|
||||||
),
|
|
||||||
};
|
|
||||||
println!("calling {:?}", call);
|
|
||||||
let info = call.get_dispatch_info();
|
|
||||||
// convert to outer call.
|
|
||||||
let call = RuntimeCall::System(call);
|
|
||||||
let len = call.using_encoded(|e| e.len()) as u32;
|
|
||||||
|
|
||||||
let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default()
|
let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default()
|
||||||
.build_storage::<Runtime>()
|
.build_storage::<Runtime>()
|
||||||
@@ -2112,7 +2103,7 @@ mod multiplier_tests {
|
|||||||
while multiplier <= Multiplier::from_u32(1) {
|
while multiplier <= Multiplier::from_u32(1) {
|
||||||
t.execute_with(|| {
|
t.execute_with(|| {
|
||||||
// imagine this tx was called.
|
// imagine this tx was called.
|
||||||
let fee = TransactionPayment::compute_fee(len, &info, 0);
|
let fee = TransactionPayment::compute_fee(0, &info, 0);
|
||||||
fees_paid += fee;
|
fees_paid += fee;
|
||||||
|
|
||||||
// this will update the multiplier.
|
// this will update the multiplier.
|
||||||
|
|||||||
@@ -2299,7 +2299,7 @@ mod test {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod multiplier_tests {
|
mod multiplier_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use frame_support::{dispatch::GetDispatchInfo, traits::OnFinalize};
|
use frame_support::{dispatch::DispatchInfo, traits::OnFinalize};
|
||||||
use runtime_common::{MinimumMultiplier, TargetBlockFullness};
|
use runtime_common::{MinimumMultiplier, TargetBlockFullness};
|
||||||
use separator::Separatable;
|
use separator::Separatable;
|
||||||
use sp_runtime::traits::Convert;
|
use sp_runtime::traits::Convert;
|
||||||
@@ -2341,17 +2341,8 @@ mod multiplier_tests {
|
|||||||
let mut blocks = 0;
|
let mut blocks = 0;
|
||||||
let mut fees_paid = 0;
|
let mut fees_paid = 0;
|
||||||
|
|
||||||
let call = frame_system::Call::<Runtime>::fill_block {
|
frame_system::Pallet::<Runtime>::set_block_consumed_resources(Weight::MAX, 0);
|
||||||
ratio: Perbill::from_rational(
|
let info = DispatchInfo { weight: Weight::MAX, ..Default::default() };
|
||||||
block_weight.ref_time(),
|
|
||||||
BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap().ref_time(),
|
|
||||||
),
|
|
||||||
};
|
|
||||||
println!("calling {:?}", call);
|
|
||||||
let info = call.get_dispatch_info();
|
|
||||||
// convert to outer call.
|
|
||||||
let call = RuntimeCall::System(call);
|
|
||||||
let len = call.using_encoded(|e| e.len()) as u32;
|
|
||||||
|
|
||||||
let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default()
|
let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default()
|
||||||
.build_storage::<Runtime>()
|
.build_storage::<Runtime>()
|
||||||
@@ -2365,7 +2356,7 @@ mod multiplier_tests {
|
|||||||
while multiplier <= Multiplier::from_u32(1) {
|
while multiplier <= Multiplier::from_u32(1) {
|
||||||
t.execute_with(|| {
|
t.execute_with(|| {
|
||||||
// imagine this tx was called.
|
// imagine this tx was called.
|
||||||
let fee = TransactionPayment::compute_fee(len, &info, 0);
|
let fee = TransactionPayment::compute_fee(0, &info, 0);
|
||||||
fees_paid += fee;
|
fees_paid += fee;
|
||||||
|
|
||||||
// this will update the multiplier.
|
// this will update the multiplier.
|
||||||
|
|||||||
Reference in New Issue
Block a user