Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit c503fa7

Browse files
saturating math
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
1 parent fd38356 commit c503fa7

File tree

1 file changed

+3
-3
lines changed
  • frame/election-provider-multi-phase/src

1 file changed

+3
-3
lines changed

frame/election-provider-multi-phase/src/signed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ impl<T: Config> Pallet<T> {
249249
let encoded_len: BalanceOf<T> = encoded_len.into();
250250
let feasibility_weight = Self::feasibility_weight_of(solution, size);
251251

252-
let len_deposit = T::SignedDepositByte::get() * encoded_len;
253-
let weight_deposit = T::SignedDepositWeight::get() * feasibility_weight.saturated_into();
252+
let len_deposit = T::SignedDepositByte::get().saturating_mul(encoded_len);
253+
let weight_deposit = T::SignedDepositWeight::get().saturating_mul(feasibility_weight.saturated_into());
254254

255-
T::SignedDepositBase::get() + len_deposit + weight_deposit
255+
T::SignedDepositBase::get().saturating_add(len_deposit).saturating_add(weight_deposit)
256256
}
257257
}
258258

0 commit comments

Comments
 (0)