pallet-session: Migrate the historical part to the new pallet macro (#9878)

* Migrate session-historical to the new pallet macro

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* pallet-session: Migrate the historical part to the new pallet macro

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Fix staking test runtime

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update frame/session/src/historical/mod.rs

* Update frame/session/src/historical/mod.rs

* update migration doc

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* use hardcoded prefix for migration v1

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* cargo +nightly-2021-11-08 fmt

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Qinxuan Chen
2021-11-17 15:16:28 +08:00
committed by GitHub
parent 256c35f473
commit 0b224d1b60
8 changed files with 325 additions and 66 deletions
@@ -22,6 +22,7 @@
mod mock;
use sp_runtime::traits::{One, StaticLookup};
use sp_std::{prelude::*, vec};
use frame_benchmarking::benchmarks;
@@ -30,12 +31,11 @@ use frame_support::{
traits::{KeyOwnerProofSystem, OnInitialize},
};
use frame_system::RawOrigin;
use pallet_session::{historical::Module as Historical, Pallet as Session, *};
use pallet_session::{historical::Pallet as Historical, Pallet as Session, *};
use pallet_staking::{
benchmarking::create_validator_with_nominators, testing_utils::create_validators,
RewardDestination,
};
use sp_runtime::traits::{One, StaticLookup};
const MAX_VALIDATORS: u32 = 1000;