Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
33b105b
Decouple the session validators from im-online
liuchengxu Sep 17, 2020
d5ce27f
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Sep 18, 2020
1070e51
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Sep 20, 2020
526dbd7
.
liuchengxu Sep 20, 2020
5f1ab56
Add SessionInterface trait in im-online
liuchengxu Sep 23, 2020
451179d
Merge branch 'make-im-online-validator-set-flexiable' of https://gith…
liuchengxu Sep 24, 2020
725ca92
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Sep 24, 2020
141b27b
Fix merging issue
liuchengxu Sep 24, 2020
9bed321
Make all compile
liuchengxu Sep 24, 2020
1582b7b
Fix tests
liuchengxu Sep 24, 2020
8fded12
Avoid using frame dep in primitives via pallet-session-common
liuchengxu Sep 24, 2020
db2d1a4
Merge ValidatorSet into SessionInterface trait
liuchengxu Sep 24, 2020
9f1344d
Move pallet-sesion-common into pallet-session
liuchengxu Sep 25, 2020
d5a3b4f
Move SessionInterface to sp-session and impl it in session pallet
liuchengxu Sep 25, 2020
004bde7
Split put historical::FullValidatorIdentification trait
liuchengxu Sep 26, 2020
c395c81
Fix line width
liuchengxu Sep 26, 2020
550632d
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Sep 26, 2020
4ebb2ef
Fix staking mock
liuchengxu Sep 26, 2020
5a92424
Fix session doc test
liuchengxu Sep 26, 2020
90efb67
Simplify <T as ValidatorIdentification<AccountId>>::ValidatorId as Va…
liuchengxu Sep 27, 2020
1a71e3e
Nits
liuchengxu Sep 27, 2020
e1abd33
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 5, 2020
ee947a5
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 18, 2020
f274541
Clean up.
tomusdrw Oct 19, 2020
c87f862
Make it compile by commenting out report_offence_im_online bench
liuchengxu Oct 22, 2020
1840186
Tests
liuchengxu Oct 22, 2020
da2d4a5
Nits
liuchengxu Oct 22, 2020
58e9fcc
Move OneSessionHandler to sp-session
liuchengxu Oct 22, 2020
7066c13
Fix tests
liuchengxu Oct 22, 2020
9eea0a3
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 22, 2020
1848bd7
Add some docs
liuchengxu Oct 22, 2020
650f279
.
liuchengxu Oct 23, 2020
ee81bf1
Fix typo
liuchengxu Oct 23, 2020
e7598a3
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 28, 2020
ff94e6b
Rename to ValidatorSet::session_index()
liuchengxu Oct 28, 2020
7d5cceb
Add some more docs
liuchengxu Oct 28, 2020
de08937
.
liuchengxu Oct 28, 2020
e28377b
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 28, 2020
6e07546
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 31, 2020
6c42cc8
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Nov 2, 2020
fe9e17a
Remove extra empty line
liuchengxu Nov 2, 2020
3fdb3c4
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Nov 3, 2020
6d8defa
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Nov 4, 2020
aef33ca
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Nov 9, 2020
b919689
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 4, 2021
516afb2
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 14, 2021
c4158d7
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 20, 2021
ea357a3
Fix line width check
liuchengxu Jan 20, 2021
6937b72
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 21, 2021
7a265af
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 24, 2021
d4787ad
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 25, 2021
2c007d0
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 27, 2021
a34f75c
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 1, 2021
04f247c
Merge branch 'make-im-online-validator-set-flexiable' of https://gith…
liuchengxu Feb 1, 2021
865bfd8
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 2, 2021
0a39d79
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 2, 2021
e8c8ce5
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 2, 2021
12ff709
Apply suggestions from code review
liuchengxu Feb 2, 2021
12324f3
Cleaup Cargo.toml
liuchengxu Feb 2, 2021
3551036
Aura has migrated to Pallet now
liuchengxu Feb 2, 2021
8e392fa
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid using frame dep in primitives via pallet-session-common
  • Loading branch information
liuchengxu committed Sep 24, 2020
commit 8fded1264c936ed01f10112e5d2a950e69fc34b6
11 changes: 10 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ members = [
"frame/scored-pool",
"frame/session",
"frame/session/benchmarking",
"frame/session/common",
"frame/society",
"frame/staking",
"frame/staking/reward-curve",
Expand Down
8 changes: 4 additions & 4 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ parameter_types! {
}


impl sp_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId> for Runtime {
impl pallet_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId> for Runtime {
type ValidatorId = <Self as frame_system::Trait>::AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
Expand Down Expand Up @@ -757,8 +757,8 @@ impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
type OverarchingCall = Call;
}

impl pallet_im_online::ValidatorSet<<Self as sp_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId> for Runtime {
fn validators() -> Vec<<Self as sp_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId> {
impl pallet_im_online::ValidatorSet<<Self as pallet_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId> for Runtime {
fn validators() -> Vec<<Self as pallet_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId> {
Session::validators()
}
}
Expand Down Expand Up @@ -786,7 +786,7 @@ parameter_types! {

impl pallet_offences::Trait for Runtime {
type Event = Event;
type IdentificationTuple = sp_session::IdentificationTuple<<Self as frame_system::Trait>::AccountId, Self>;
type IdentificationTuple = pallet_session::IdentificationTuple<<Self as frame_system::Trait>::AccountId, Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
}
Expand Down
2 changes: 1 addition & 1 deletion frame/authority-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mod tests {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
}

impl sp_session::ValidatorIdentification<AuthorityId> for Test {
impl pallet_session::ValidatorIdentification<AuthorityId> for Test {
type ValidatorId = AuthorityId;
type ValidatorIdOf = ConvertInto;
type FullIdentification = ();
Expand Down
4 changes: 2 additions & 2 deletions frame/babe/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl_opaque_keys! {
}
}

impl sp_session::ValidatorIdentification<DummyValidatorId> for Test {
impl pallet_session::ValidatorIdentification<DummyValidatorId> for Test {
type ValidatorId = <Self as frame_system::Trait>::AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
type FullIdentification = pallet_staking::Exposure<u64, u128>;
Expand Down Expand Up @@ -229,7 +229,7 @@ parameter_types! {

impl pallet_offences::Trait for Test {
type Event = ();
type IdentificationTuple = sp_session::IdentificationTuple<DummyValidatorId, Self>;
type IdentificationTuple = pallet_session::IdentificationTuple<DummyValidatorId, Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
}
Expand Down
4 changes: 2 additions & 2 deletions frame/grandpa/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
}

impl sp_session::ValidatorIdentification<u64> for Test {
impl pallet_session::ValidatorIdentification<u64> for Test {
type ValidatorId = u64;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
type FullIdentification = pallet_staking::Exposure<u64, u128>;
Expand Down Expand Up @@ -244,7 +244,7 @@ parameter_types! {

impl pallet_offences::Trait for Test {
type Event = TestEvent;
type IdentificationTuple = sp_session::IdentificationTuple<u64, Self>;
type IdentificationTuple = pallet_session::IdentificationTuple<u64, Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
}
Expand Down
2 changes: 2 additions & 0 deletions frame/im-online/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ sp-runtime = { version = "2.0.0", default-features = false, path = "../../primit
sp-staking = { version = "2.0.0", default-features = false, path = "../../primitives/staking" }
frame-support = { version = "2.0.0", default-features = false, path = "../support" }
frame-system = { version = "2.0.0", default-features = false, path = "../system" }
pallet-session-common = { version = "2.0.0", default-features = false, path = "../session/common" }

frame-benchmarking = { version = "2.0.0", default-features = false, path = "../benchmarking", optional = true }

Expand All @@ -45,5 +46,6 @@ std = [
"sp-staking/std",
"frame-support/std",
"frame-system/std",
"pallet-session-common/std",
]
runtime-benchmarks = ["frame-benchmarking"]
2 changes: 1 addition & 1 deletion frame/im-online/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ use codec::{Encode, Decode};
use sp_core::offchain::OpaqueNetworkState;
use sp_std::prelude::*;
use sp_std::convert::TryInto;
use sp_session::{IdentificationTuple, ValidatorIdentification};
use sp_runtime::{
offchain::storage::StorageValueRef,
RuntimeDebug,
Expand All @@ -103,6 +102,7 @@ use frame_system::offchain::{
SendTransactionTypes,
SubmitTransaction,
};
use pallet_session_common::{IdentificationTuple, ValidatorIdentification};

pub mod sr25519 {
mod app_sr25519 {
Expand Down
4 changes: 2 additions & 2 deletions frame/im-online/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use sp_runtime::testing::{Header, UintAuthorityId, TestXt};
use sp_runtime::traits::{IdentityLookup, BlakeTwo256, ConvertInto};
use sp_core::H256;
use frame_support::{impl_outer_origin, impl_outer_dispatch, parameter_types, weights::Weight};
use sp_session::ValidatorIdentification;
use pallet_session::ValidatorIdentification;

impl_outer_origin!{
pub enum Origin for Runtime {}
Expand Down Expand Up @@ -147,7 +147,7 @@ parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
}

impl sp_session::ValidatorIdentification<u64> for Runtime {
impl pallet_session::ValidatorIdentification<u64> for Runtime {
type ValidatorId = u64;
type ValidatorIdOf = ConvertInto;
type FullIdentification = u64;
Expand Down
3 changes: 1 addition & 2 deletions frame/offences/benchmarking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ use frame_support::traits::{Currency, OnInitialize};

use sp_runtime::{Perbill, traits::{Convert, StaticLookup, Saturating, UniqueSaturatedInto}};
use sp_staking::offence::{ReportOffence, Offence, OffenceDetails};
use sp_session::{IdentificationTuple, ValidatorIdentification};

use pallet_balances::{Trait as BalancesTrait};
use pallet_babe::BabeEquivocationOffence;
use pallet_grandpa::{GrandpaEquivocationOffence, GrandpaTimeSlot};
use pallet_im_online::{Trait as ImOnlineTrait, Module as ImOnline, UnresponsivenessOffence};
use pallet_offences::{Trait as OffencesTrait, Module as Offences};
use pallet_session::historical::{Trait as HistoricalTrait};
use pallet_session::{Trait as SessionTrait, SessionManager};
use pallet_session::{Trait as SessionTrait, SessionManager, IdentificationTuple, ValidatorIdentification};
use pallet_staking::{
Module as Staking, Trait as StakingTrait, RewardDestination, ValidatorPrefs,
Exposure, IndividualExposure, ElectionStatus, MAX_NOMINATIONS, Event as StakingEvent
Expand Down
8 changes: 4 additions & 4 deletions frame/offences/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl pallet_timestamp::Trait for Test {
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
impl sp_session::ValidatorIdentification<AccountId> for Test {
impl pallet_session::ValidatorIdentification<AccountId> for Test {
type ValidatorId = AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Test>;
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
Expand Down Expand Up @@ -187,8 +187,8 @@ impl pallet_staking::Trait for Test {
type WeightInfo = ();
}

impl pallet_im_online::ValidatorSet<<Self as sp_session::ValidatorIdentification<AccountId>>::ValidatorId> for Test {
fn validators() -> Vec<<Self as sp_session::ValidatorIdentification<AccountId>>::ValidatorId> {
impl pallet_im_online::ValidatorSet<<Self as pallet_session::ValidatorIdentification<AccountId>>::ValidatorId> for Test {
fn validators() -> Vec<<Self as pallet_session::ValidatorIdentification<AccountId>>::ValidatorId> {
Session::validators()
}
}
Expand Down Expand Up @@ -216,7 +216,7 @@ parameter_types! {

impl pallet_offences::Trait for Test {
type Event = Event;
type IdentificationTuple = sp_session::IdentificationTuple<AccountId, Self>;
type IdentificationTuple = pallet_session::IdentificationTuple<AccountId, Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
}
Expand Down
2 changes: 2 additions & 0 deletions frame/session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ sp-session = { version = "2.0.0", default-features = false, path = "../../primit
sp-staking = { version = "2.0.0", default-features = false, path = "../../primitives/staking" }
frame-support = { version = "2.0.0", default-features = false, path = "../support" }
frame-system = { version = "2.0.0", default-features = false, path = "../system" }
pallet-session-common = { version = "2.0.0", default-features = false, path = "./common" }
pallet-timestamp = { version = "2.0.0", default-features = false, path = "../timestamp" }
sp-trie = { version = "2.0.0", optional = true, default-features = false, path = "../../primitives/trie" }
impl-trait-for-tuples = "0.1.3"
Expand All @@ -45,6 +46,7 @@ std = [
"sp-runtime/std",
"sp-session/std",
"sp-staking/std",
"pallet-session-common/std",
"pallet-timestamp/std",
"sp-trie/std",
]
2 changes: 1 addition & 1 deletion frame/session/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl pallet_timestamp::Trait for Test {
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
impl sp_session::ValidatorIdentification<AccountId> for Test {
impl pallet_session::ValidatorIdentification<AccountId> for Test {
type ValidatorId = AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Test>;
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
Expand Down
2 changes: 1 addition & 1 deletion frame/session/src/historical/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use sp_trie::{MemoryDB, Trie, TrieMut, Recorder, EMPTY_PREFIX};
use sp_trie::trie_types::{TrieDBMut, TrieDB};
use super::{SessionIndex, Module as SessionModule};

pub use sp_session::IdentificationTuple;
pub use pallet_session_common::IdentificationTuple;

mod shared;
pub mod offchain;
Expand Down
2 changes: 1 addition & 1 deletion frame/session/src/historical/offchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ mod tests {
};

use sp_runtime::testing::UintAuthorityId;
use sp_session::ValidatorIdentification;
use crate::ValidatorIdentification;

type Historical = Module<Test>;

Expand Down
2 changes: 1 addition & 1 deletion frame/session/src/historical/onchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use super::Trait as HistoricalTrait;

use super::shared;
use sp_std::prelude::*;
use sp_session::ValidatorIdentification;
use pallet_session_common::ValidatorIdentification;

/// Store the validator-set associated to the `session_index` to the off-chain database.
///
Expand Down
3 changes: 2 additions & 1 deletion frame/session/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@

use sp_std::{prelude::*, marker::PhantomData, ops::{Sub, Rem}};
use codec::Decode;
use sp_session::ValidatorIdentification;
use sp_runtime::{KeyTypeId, Perbill, RuntimeAppPublic, BoundToRuntimeAppPublic};
use sp_runtime::traits::{Convert, Zero, Member, OpaqueKeys, Saturating};
use sp_staking::SessionIndex;
Expand All @@ -116,6 +115,8 @@ use frame_support::{
};
use frame_system::ensure_signed;

pub use pallet_session_common::{IdentificationTuple, ValidatorIdentification};

#[cfg(test)]
mod mock;
#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion frame/session/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
}

impl sp_session::ValidatorIdentification<u64> for Test {
impl crate::ValidatorIdentification<u64> for Test {
type ValidatorId = u64;
type ValidatorIdOf = ConvertInto;
type FullIdentification = u64;
Expand Down
2 changes: 1 addition & 1 deletion frame/staking/fuzzer/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl pallet_timestamp::Trait for Test {
impl pallet_session::historical::Trait for Test {
}

impl sp_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId> for Test {
impl pallet_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId> for Test {
type ValidatorId = AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Test>;
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
Expand Down
4 changes: 2 additions & 2 deletions frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3175,7 +3175,7 @@ impl<T: Trait> Convert<T::AccountId, Option<Exposure<T::AccountId, BalanceOf<T>>

/// This is intended to be used with `FilterHistoricalOffences`.
impl <T: Trait>
OnOffenceHandler<T::AccountId, sp_session::IdentificationTuple<<T as frame_system::Trait>::AccountId, T>, Weight>
OnOffenceHandler<T::AccountId, pallet_session::IdentificationTuple<<T as frame_system::Trait>::AccountId, T>, Weight>
for Module<T> where
T: pallet_session::Trait<ValidatorId = <T as frame_system::Trait>::AccountId>,
T: pallet_session::historical::Trait<
Expand All @@ -3190,7 +3190,7 @@ for Module<T> where
>,
{
fn on_offence(
offenders: &[OffenceDetails<T::AccountId, sp_session::IdentificationTuple<<T as frame_system::Trait>::AccountId, T>>],
offenders: &[OffenceDetails<T::AccountId, pallet_session::IdentificationTuple<<T as frame_system::Trait>::AccountId, T>>],
slash_fraction: &[Perbill],
slash_session: SessionIndex,
) -> Result<Weight, ()> {
Expand Down
6 changes: 3 additions & 3 deletions frame/staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ sp_runtime::impl_opaque_keys! {
}
}

impl sp_session::ValidatorIdentification<AccountId> for Test {
impl pallet_session::ValidatorIdentification<AccountId> for Test {
type ValidatorId = AccountId;
type ValidatorIdOf = crate::StashOf<Test>;
type FullIdentification = crate::Exposure<AccountId, Balance>;
Expand Down Expand Up @@ -742,7 +742,7 @@ pub(crate) fn validator_controllers() -> Vec<AccountId> {
pub(crate) fn on_offence_in_era(
offenders: &[OffenceDetails<
AccountId,
sp_session::IdentificationTuple<AccountId, Test>,
pallet_session::IdentificationTuple<AccountId, Test>,
>],
slash_fraction: &[Perbill],
era: EraIndex,
Expand Down Expand Up @@ -770,7 +770,7 @@ pub(crate) fn on_offence_in_era(
}

pub(crate) fn on_offence_now(
offenders: &[OffenceDetails<AccountId, sp_session::IdentificationTuple<AccountId, Test>>],
offenders: &[OffenceDetails<AccountId, pallet_session::IdentificationTuple<AccountId, Test>>],
slash_fraction: &[Perbill],
) {
let now = Staking::active_era().unwrap().index;
Expand Down
2 changes: 1 addition & 1 deletion frame/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4576,7 +4576,7 @@ fn offences_weight_calculated_correctly() {
let n_offence_unapplied_weight = <Test as frame_system::Trait>::DbWeight::get().reads_writes(4, 1)
+ <Test as frame_system::Trait>::DbWeight::get().reads_writes(4, 5);

let offenders: Vec<OffenceDetails<<Test as frame_system::Trait>::AccountId, sp_session::IdentificationTuple<<Test as frame_system::Trait>::AccountId, Test>>>
let offenders: Vec<OffenceDetails<<Test as frame_system::Trait>::AccountId, pallet_session::IdentificationTuple<<Test as frame_system::Trait>::AccountId, Test>>>
= (1..10).map(|i|
OffenceDetails {
offender: (i, Staking::eras_stakers(Staking::active_era().unwrap().index, i)),
Expand Down
2 changes: 0 additions & 2 deletions primitives/session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ sp-core = { version = "2.0.0", default-features = false, path = "../core" }
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
sp-staking = { version = "2.0.0", default-features = false, path = "../staking" }
sp-runtime = { version = "2.0.0", default-features = false, path = "../runtime" }
frame-support = { version = "2.0.0", default-features = false, path = "../../frame/support" }

[features]
default = [ "std" ]
Expand All @@ -30,5 +29,4 @@ std = [
"sp-std/std",
"sp-staking/std",
"sp-runtime/std",
"frame-support/std",
]
Loading