From f4b80d7200c19b78d3777e8a4a87bc6893740d23 Mon Sep 17 00:00:00 2001 From: Xiliang Chen Date: Mon, 4 Apr 2022 10:24:59 +1200 Subject: [PATCH] be srtool compatible (#2021) --- runtime/common/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 599205ecee..aaf0d5f869 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -120,7 +120,9 @@ impl Convert for GasToWeight { pub struct WeightToGas; impl Convert 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;") } }