Skip to content

Commit

Permalink
be srtool compatible (#2021)
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc authored Apr 3, 2022
1 parent 4dc2b49 commit f4b80d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ impl Convert<u64, Weight> for GasToWeight {
pub struct WeightToGas;
impl Convert<Weight, u64> for WeightToGas {
fn convert(weight: Weight) -> u64 {
weight.saturating_div(gas_to_weight_ratio::RATIO)
weight
.checked_div(gas_to_weight_ratio::RATIO)
.expect("Compile-time constant is not zero; qed;")
}
}

Expand Down

0 comments on commit f4b80d7

Please sign in to comment.