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 all commits
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
512 changes: 256 additions & 256 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions parachains/runtimes/assets/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,11 @@ impl_runtime_apis! {
fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}

fn export_message_origin_and_destination(
) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> {
Err(BenchmarkError::Skip)
}
}

type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
Expand Down Expand Up @@ -1287,8 +1292,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
11 changes: 9 additions & 2 deletions parachains/runtimes/assets/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,11 @@ impl_runtime_apis! {
fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}

fn export_message_origin_and_destination(
) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> {
Err(BenchmarkError::Skip)
}
}

type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
Expand Down Expand Up @@ -1138,8 +1143,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
5 changes: 5 additions & 0 deletions parachains/runtimes/assets/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,11 @@ impl_runtime_apis! {
fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}

fn export_message_origin_and_destination(
) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> {
Err(BenchmarkError::Skip)
}
}

type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
Expand Down
5 changes: 5 additions & 0 deletions parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,11 @@ impl_runtime_apis! {
fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}

fn export_message_origin_and_destination(
) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> {
Err(BenchmarkError::Skip)
}
}

type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,11 @@ impl_runtime_apis! {
fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}

fn export_message_origin_and_destination(
) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> {
Err(BenchmarkError::Skip)
}
}

type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
Expand Down
5 changes: 5 additions & 0 deletions parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,11 @@ impl_runtime_apis! {
fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}

fn export_message_origin_and_destination(
) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> {
Err(BenchmarkError::Skip)
}
}

type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
Expand Down