mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 19:11:04 +00:00
Migrate pallet-session to the new pallet macro (#9796)
* Migrate pallet-session to the new pallet macro Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Remove old macros Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Fix Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -30,15 +30,11 @@ use sp_runtime::{
|
||||
KeyTypeId,
|
||||
};
|
||||
use sp_session::MembershipProof;
|
||||
|
||||
use super::{
|
||||
super::{Pallet as SessionModule, SessionIndex},
|
||||
Config, IdentificationTuple, ProvingTrie,
|
||||
};
|
||||
|
||||
use super::shared;
|
||||
use sp_std::prelude::*;
|
||||
|
||||
use super::{shared, Config, IdentificationTuple, ProvingTrie};
|
||||
use crate::{Pallet as SessionModule, SessionIndex};
|
||||
|
||||
/// A set of validators, which was used for a fixed session index.
|
||||
struct ValidatorSet<T: Config> {
|
||||
validator_set: Vec<IdentificationTuple<T>>,
|
||||
@@ -142,23 +138,24 @@ pub fn keep_newest<T: Config>(n_to_keep: usize) {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{
|
||||
super::{onchain, Module},
|
||||
*,
|
||||
};
|
||||
use crate::mock::{
|
||||
force_new_session, set_next_validators, Session, System, Test, NEXT_VALIDATORS,
|
||||
use super::*;
|
||||
use crate::{
|
||||
historical::{onchain, Module},
|
||||
mock::{force_new_session, set_next_validators, Session, System, Test, NEXT_VALIDATORS},
|
||||
};
|
||||
|
||||
use codec::Encode;
|
||||
use frame_support::traits::{KeyOwnerProofSystem, OnInitialize};
|
||||
use sp_core::{
|
||||
crypto::key_types::DUMMY,
|
||||
offchain::{testing::TestOffchainExt, OffchainDbExt, OffchainWorkerExt, StorageKind},
|
||||
};
|
||||
|
||||
use frame_support::BasicExternalities;
|
||||
use sp_runtime::testing::UintAuthorityId;
|
||||
|
||||
use frame_support::{
|
||||
traits::{GenesisBuild, KeyOwnerProofSystem, OnInitialize},
|
||||
BasicExternalities,
|
||||
};
|
||||
|
||||
type Historical = Module<Test>;
|
||||
|
||||
pub fn new_test_ext() -> sp_io::TestExternalities {
|
||||
|
||||
Reference in New Issue
Block a user