diff --git a/node/runtime/src/lib.rs b/node/runtime/src/lib.rs index b3daece243a7..22dcba93a5dc 100644 --- a/node/runtime/src/lib.rs +++ b/node/runtime/src/lib.rs @@ -58,8 +58,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("node"), impl_name: create_runtime_str!("substrate-node"), authoring_version: 10, - spec_version: 72, - impl_version: 74, + spec_version: 73, + impl_version: 73, apis: RUNTIME_API_VERSIONS, }; diff --git a/srml/balances/src/lib.rs b/srml/balances/src/lib.rs index 7f2c1752a964..0983c2757a92 100644 --- a/srml/balances/src/lib.rs +++ b/srml/balances/src/lib.rs @@ -167,7 +167,7 @@ pub use self::imbalances::{PositiveImbalance, NegativeImbalance}; pub trait Subtrait: system::Trait { /// The balance of an account. - type Balance: Parameter + Member + SimpleArithmetic + Codec + Default + Copy + As + As + MaybeSerializeDebug; + type Balance: Parameter + Member + SimpleArithmetic + Codec + Default + Copy + MaybeSerializeDebug; /// A function that is invoked when the free-balance has fallen below the existential deposit and /// has been reduced to zero. @@ -181,7 +181,7 @@ pub trait Subtrait: system::Trait { pub trait Trait: system::Trait { /// The balance of an account. - type Balance: Parameter + Member + SimpleArithmetic + Codec + Default + Copy + As + As + MaybeSerializeDebug; + type Balance: Parameter + Member + SimpleArithmetic + Codec + Default + Copy + MaybeSerializeDebug; /// A function that is invoked when the free-balance has fallen below the existential deposit and /// has been reduced to zero. diff --git a/srml/staking/src/lib.rs b/srml/staking/src/lib.rs index cc3c708bb284..09007b48d5b2 100644 --- a/srml/staking/src/lib.rs +++ b/srml/staking/src/lib.rs @@ -894,8 +894,10 @@ impl Module { Self::reward_validator(v, reward); } Self::deposit_event(RawEvent::Reward(reward)); - let total_minted = reward * as As>::sa(validators.len()); - let total_rewarded_stake = Self::slot_stake() * as As>::sa(validators.len()); + let len = validators.len() as u64; // validators length can never overflow u64 + let len = BalanceOf::::sa(len); + let total_minted = reward * len; + let total_rewarded_stake = Self::slot_stake() * len; T::OnRewardMinted::on_dilution(total_minted, total_rewarded_stake); } diff --git a/srml/support/src/traits.rs b/srml/support/src/traits.rs index 6f0435a77a01..67b1f973ce4d 100644 --- a/srml/support/src/traits.rs +++ b/srml/support/src/traits.rs @@ -19,7 +19,7 @@ use crate::rstd::result; use crate::codec::{Codec, Encode, Decode}; use crate::runtime_primitives::traits::{ - MaybeSerializeDebug, SimpleArithmetic, As + MaybeSerializeDebug, SimpleArithmetic }; /// The account with the given id was killed. @@ -195,7 +195,7 @@ pub enum SignedImbalance>{ impl< P: Imbalance, N: Imbalance, - B: SimpleArithmetic + As + As + Codec + Copy + MaybeSerializeDebug + Default, + B: SimpleArithmetic + Codec + Copy + MaybeSerializeDebug + Default, > SignedImbalance { pub fn zero() -> Self { SignedImbalance::Positive(P::zero()) @@ -230,7 +230,7 @@ impl< /// Abstraction over a fungible assets system. pub trait Currency { /// The balance of an account. - type Balance: SimpleArithmetic + As + As + Codec + Copy + MaybeSerializeDebug + Default; + type Balance: SimpleArithmetic + Codec + Copy + MaybeSerializeDebug + Default; /// The opaque token type for an imbalance. This is returned by unbalanced operations /// and must be dealt with. It may be dropped but cannot be cloned.