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

Co #13637: Remove Weight::without_{ref_time, proof_size} #2346

Merged
merged 5 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions parachains/runtimes/assets/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,10 @@ mod tests {
#[test]
fn full_block_fee_ratio() {
let block = RuntimeBlockWeights::get().max_block;
let time_fee: Balance = fee::WeightToFee::weight_to_fee(&block.without_proof_size());
let proof_fee: Balance = fee::WeightToFee::weight_to_fee(&block.without_ref_time());
let time_fee: Balance =
fee::WeightToFee::weight_to_fee(Weight::from_parts(block.ref_time(), 0));
let proof_fee: Balance =
fee::WeightToFee::weight_to_fee(Weight::from_parts(0, block.proof_size()));

let proof_o_time = proof_fee.checked_div(time_fee).unwrap_or_default();
assert!(proof_o_time <= 30, "{} should be at most 30", proof_o_time);
Expand Down
6 changes: 4 additions & 2 deletions parachains/runtimes/assets/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,10 @@ mod tests {
#[test]
fn full_block_fee_ratio() {
let block = RuntimeBlockWeights::get().max_block;
let time_fee: Balance = fee::WeightToFee::weight_to_fee(&block.without_proof_size());
let proof_fee: Balance = fee::WeightToFee::weight_to_fee(&block.without_ref_time());
let time_fee: Balance =
fee::WeightToFee::weight_to_fee(Weight::from_parts(block.ref_time(), 0));
let proof_fee: Balance =
fee::WeightToFee::weight_to_fee(Weight::from_parts(0, block.proof_size()));

let proof_o_time = proof_fee.checked_div(time_fee).unwrap_or_default();
assert!(proof_o_time <= 30, "{} should be at most 30", proof_o_time);
Expand Down