mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 07:01:03 +00:00
Decouple the session validators from im-online (#7127)
* Decouple the session validators from im-online * . * Add SessionInterface trait in im-online Add ValidatorId in im-online Trait Make im-online compile Make substrate binary compile * Fix merging issue * Make all compile * Fix tests * Avoid using frame dep in primitives via pallet-session-common * Merge ValidatorSet into SessionInterface trait Wrap a few too long lines Add some docs * Move pallet-sesion-common into pallet-session * Move SessionInterface to sp-session and impl it in session pallet Ref https://github.com/paritytech/substrate/pull/7127#discussion_r494892472 * Split put historical::FullValidatorIdentification trait * Fix line width * Fix staking mock * Fix session doc test * Simplify <T as ValidatorIdentification<AccountId>>::ValidatorId as ValidatorId<T> * Nits * Clean up. * Make it compile by commenting out report_offence_im_online bench * Tests * Nits * Move OneSessionHandler to sp-session * Fix tests * Add some docs * . * Fix typo * Rename to ValidatorSet::session_index() * Add some more docs * . * Remove extra empty line * Fix line width check . * Apply suggestions from code review * Cleaup Cargo.toml * Aura has migrated to Pallet now Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
This commit is contained in:
@@ -41,7 +41,7 @@ use fg_primitives::{
|
||||
};
|
||||
use frame_support::{
|
||||
decl_error, decl_event, decl_module, decl_storage, dispatch::DispatchResultWithPostInfo,
|
||||
storage, traits::KeyOwnerProofSystem, weights::{Pays, Weight}, Parameter,
|
||||
storage, traits::{OneSessionHandler, KeyOwnerProofSystem}, weights::{Pays, Weight}, Parameter,
|
||||
};
|
||||
use frame_system::{ensure_none, ensure_root, ensure_signed};
|
||||
use sp_runtime::{
|
||||
@@ -587,7 +587,7 @@ impl<T: Config> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
|
||||
type Public = AuthorityId;
|
||||
}
|
||||
|
||||
impl<T: Config> pallet_session::OneSessionHandler<T::AccountId> for Module<T>
|
||||
impl<T: Config> OneSessionHandler<T::AccountId> for Module<T>
|
||||
where T: pallet_session::Config
|
||||
{
|
||||
type Key = AuthorityId;
|
||||
|
||||
@@ -25,11 +25,10 @@ use codec::{Decode, Encode};
|
||||
use fg_primitives::ScheduledChange;
|
||||
use frame_support::{
|
||||
assert_err, assert_ok,
|
||||
traits::{Currency, OnFinalize},
|
||||
traits::{Currency, OnFinalize, OneSessionHandler},
|
||||
weights::{GetDispatchInfo, Pays},
|
||||
};
|
||||
use frame_system::{EventRecord, Phase};
|
||||
use pallet_session::OneSessionHandler;
|
||||
use sp_core::H256;
|
||||
use sp_keyring::Ed25519Keyring;
|
||||
use sp_runtime::testing::Digest;
|
||||
|
||||
Reference in New Issue
Block a user