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
@@ -140,7 +140,7 @@ pub fn keep_newest<T: Config>(n_to_keep: usize) {
mod tests {
use super::*;
use crate::{
historical::{onchain, Module},
historical::{onchain, Pallet},
mock::{force_new_session, set_next_validators, Session, System, Test, NEXT_VALIDATORS},
};
@@ -156,7 +156,7 @@ mod tests {
BasicExternalities,
};
type Historical = Module<Test>;
type Historical = Pallet<Test>;
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::default()