Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
remove fill_block (#6200)
Browse files Browse the repository at this point in the history
Co-authored-by: parity-processbot <>
  • Loading branch information
Szegoo authored Nov 12, 2022
1 parent 659297f commit 9a99426
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
17 changes: 4 additions & 13 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ mod tests_fess {
#[cfg(test)]
mod multiplier_tests {
use super::*;
use frame_support::{dispatch::GetDispatchInfo, traits::OnFinalize};
use frame_support::{dispatch::DispatchInfo, traits::OnFinalize};
use runtime_common::{MinimumMultiplier, TargetBlockFullness};
use separator::Separatable;
use sp_runtime::traits::Convert;
Expand Down Expand Up @@ -2088,17 +2088,8 @@ mod multiplier_tests {
let mut blocks = 0;
let mut fees_paid = 0;

let call = frame_system::Call::<Runtime>::fill_block {
ratio: Perbill::from_rational(
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;
frame_system::Pallet::<Runtime>::set_block_consumed_resources(Weight::MAX, 0);
let info = DispatchInfo { weight: Weight::MAX, ..Default::default() };

let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default()
.build_storage::<Runtime>()
Expand All @@ -2112,7 +2103,7 @@ mod multiplier_tests {
while multiplier <= Multiplier::from_u32(1) {
t.execute_with(|| {
// imagine this tx was called.
let fee = TransactionPayment::compute_fee(len, &info, 0);
let fee = TransactionPayment::compute_fee(0, &info, 0);
fees_paid += fee;

// this will update the multiplier.
Expand Down
17 changes: 4 additions & 13 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2299,7 +2299,7 @@ mod test {
#[cfg(test)]
mod multiplier_tests {
use super::*;
use frame_support::{dispatch::GetDispatchInfo, traits::OnFinalize};
use frame_support::{dispatch::DispatchInfo, traits::OnFinalize};
use runtime_common::{MinimumMultiplier, TargetBlockFullness};
use separator::Separatable;
use sp_runtime::traits::Convert;
Expand Down Expand Up @@ -2341,17 +2341,8 @@ mod multiplier_tests {
let mut blocks = 0;
let mut fees_paid = 0;

let call = frame_system::Call::<Runtime>::fill_block {
ratio: Perbill::from_rational(
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;
frame_system::Pallet::<Runtime>::set_block_consumed_resources(Weight::MAX, 0);
let info = DispatchInfo { weight: Weight::MAX, ..Default::default() };

let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default()
.build_storage::<Runtime>()
Expand All @@ -2365,7 +2356,7 @@ mod multiplier_tests {
while multiplier <= Multiplier::from_u32(1) {
t.execute_with(|| {
// imagine this tx was called.
let fee = TransactionPayment::compute_fee(len, &info, 0);
let fee = TransactionPayment::compute_fee(0, &info, 0);
fees_paid += fee;

// this will update the multiplier.
Expand Down

0 comments on commit 9a99426

Please sign in to comment.