From 56e9f5fedc91ce36a8a8dea499da7f5b5ea86426 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Thu, 14 Oct 2021 04:18:53 -0400 Subject: [PATCH] use `WEIGHT_PER_SECOND` (#4077) --- polkadot/xcm/xcm-builder/src/weight.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polkadot/xcm/xcm-builder/src/weight.rs b/polkadot/xcm/xcm-builder/src/weight.rs index 1e84a42e2a..92d26ebef1 100644 --- a/polkadot/xcm/xcm-builder/src/weight.rs +++ b/polkadot/xcm/xcm-builder/src/weight.rs @@ -156,7 +156,7 @@ impl, R: TakeRevenue> WeightTrader fn refund_weight(&mut self, weight: Weight) -> Option { let (id, units_per_second) = T::get(); let weight = weight.min(self.0); - let amount = units_per_second * (weight as u128) / 1_000_000_000_000u128; + let amount = units_per_second * (weight as u128) / (WEIGHT_PER_SECOND as u128); self.0 -= weight; self.1 = self.1.saturating_sub(amount); if amount > 0 {