From 832dc4966ffcf945cf4a0b66e40fa13f50baf9c8 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Mon, 4 Apr 2022 09:15:45 +1200 Subject: [PATCH] be srtool compatible --- 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 599205ece..aaf0d5f86 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;") } }