impl Mul + saturating_mul by converting in u64 (#1610)

This commit is contained in:
thiolliere
2019-01-29 13:36:34 +01:00
committed by Gav Wood
parent a541ee8c05
commit ecffe0c371
3 changed files with 30 additions and 18 deletions
+2 -2
View File
@@ -494,8 +494,8 @@ impl<T: Trait> Module<T> {
<session::Module<T>>::set_validators(vals);
// Update the balances for slashing/rewarding according to the stakes.
<CurrentOfflineSlash<T>>::put(Self::offline_slash().times(stake_range.1));
<CurrentSessionReward<T>>::put(Self::session_reward().times(stake_range.1));
<CurrentOfflineSlash<T>>::put(Self::offline_slash() * stake_range.1);
<CurrentSessionReward<T>>::put(Self::session_reward() * stake_range.1);
}
/// Call when a validator is determined to be offline. `count` is the
+2 -2
View File
@@ -201,7 +201,7 @@ impl<T: Trait> Module<T> {
/// The needed bond for a proposal whose spend is `value`.
fn calculate_bond(value: T::Balance) -> T::Balance {
Self::proposal_bond_minimum().max(Self::proposal_bond().times(value))
Self::proposal_bond_minimum().max(Self::proposal_bond() * value)
}
// Spend some money!
@@ -238,7 +238,7 @@ impl<T: Trait> Module<T> {
if !missed_any {
// burn some proportion of the remaining budget if we run a surplus.
let burn = Self::burn().times(budget_remaining).min(budget_remaining);
let burn = (Self::burn() * budget_remaining).min(budget_remaining);
budget_remaining -= burn;
Self::deposit_event(RawEvent::Burnt(burn))
}