diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index e9fbf3555a..31433d65cf 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -3731,7 +3731,6 @@ dependencies = [ "sr-primitives 2.0.0", "sr-std 2.0.0", "srml-session 2.0.0", - "srml-staking 2.0.0", "srml-support 2.0.0", "srml-system 2.0.0", "srml-timestamp 2.0.0", diff --git a/substrate/node/runtime/src/lib.rs b/substrate/node/runtime/src/lib.rs index 9deaa5852a..d040515104 100644 --- a/substrate/node/runtime/src/lib.rs +++ b/substrate/node/runtime/src/lib.rs @@ -80,7 +80,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to equal spec_version. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 140, + spec_version: 141, impl_version: 141, apis: RUNTIME_API_VERSIONS, }; diff --git a/substrate/srml/babe/Cargo.toml b/substrate/srml/babe/Cargo.toml index 76bd849a95..c922deb605 100644 --- a/substrate/srml/babe/Cargo.toml +++ b/substrate/srml/babe/Cargo.toml @@ -11,7 +11,6 @@ serde = { version = "1.0.93", optional = true } inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } sr-primitives = { path = "../../core/sr-primitives", default-features = false } -staking = { package = "srml-staking", path = "../staking", default-features = false } srml-support = { path = "../support", default-features = false } system = { package = "srml-system", path = "../system", default-features = false } timestamp = { package = "srml-timestamp", path = "../timestamp", default-features = false } @@ -38,5 +37,4 @@ std = [ "babe-primitives/std", "session/std", "runtime_io/std", - "staking/std", ] diff --git a/substrate/srml/babe/src/lib.rs b/substrate/srml/babe/src/lib.rs index 02099aace8..918400dd80 100644 --- a/substrate/srml/babe/src/lib.rs +++ b/substrate/srml/babe/src/lib.rs @@ -25,7 +25,7 @@ use rstd::{result, prelude::*}; use srml_support::{decl_storage, decl_module, StorageValue, StorageMap, traits::FindAuthor, traits::Get}; use timestamp::{OnTimestampSet}; use sr_primitives::{generic::DigestItem, ConsensusEngineId}; -use sr_primitives::traits::{IsMember, SaturatedConversion, Saturating, RandomnessBeacon, Convert}; +use sr_primitives::traits::{IsMember, SaturatedConversion, Saturating, RandomnessBeacon}; #[cfg(feature = "std")] use timestamp::TimestampInherentData; use codec::{Encode, Decode}; @@ -298,16 +298,11 @@ impl OnTimestampSet for Module { fn on_timestamp_set(_moment: T::Moment) { } } -impl session::OneSessionHandler for Module { +impl session::OneSessionHandler for Module { type Key = AuthorityId; fn on_new_session<'a, I: 'a>(_changed: bool, validators: I, queued_validators: I) where I: Iterator { - use staking::BalanceOf; - let to_votes = |b: BalanceOf| { - , u64>>::convert(b) - }; - // Update epoch index let epoch_index = EpochIndex::get() .checked_add(1) @@ -316,8 +311,8 @@ impl session::OneSessionHandler for Mod EpochIndex::put(epoch_index); // Update authorities. - let authorities = validators.map(|(account, k)| { - (k, to_votes(staking::Module::::stakers(account).total)) + let authorities = validators.map(|(_account, k)| { + (k, 1) }).collect::>(); Authorities::put(authorities); @@ -349,8 +344,8 @@ impl session::OneSessionHandler for Mod // After we update the current epoch, we signal the *next* epoch change // so that nodes can track changes. - let next_authorities = queued_validators.map(|(account, k)| { - (k, to_votes(staking::Module::::stakers(account).total)) + let next_authorities = queued_validators.map(|(_account, k)| { + (k, 1) }).collect::>(); let next_epoch_start_slot = EpochStartSlot::get().saturating_add(T::EpochDuration::get());