mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 13:31:10 +00:00
Remove migration code. (#5291)
* Remove migration code. * Fix cargo * Bump spec version
This commit is contained in:
@@ -67,25 +67,7 @@ decl_storage! {
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
fn on_initialize(_n: T::BlockNumber) {
|
||||
CachedObsolete::<T>::remove_all();
|
||||
}
|
||||
fn on_runtime_upgrade() {
|
||||
migration::migrate::<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod migration {
|
||||
use super::*;
|
||||
pub fn migrate<T: Trait>() {
|
||||
if let Some((begin, end)) = StoredRange::get() {
|
||||
for i in begin..end {
|
||||
HistoricalSessions::<T>::migrate_key_from_blake(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin {}
|
||||
}
|
||||
|
||||
impl<T: Trait> Module<T> {
|
||||
|
||||
@@ -109,7 +109,6 @@ use frame_support::{ensure, decl_module, decl_event, decl_storage, decl_error, C
|
||||
use frame_support::{traits::{Get, FindAuthor, ValidatorRegistration}, Parameter};
|
||||
use frame_support::dispatch::{self, DispatchResult, DispatchError};
|
||||
use frame_system::{self as system, ensure_signed};
|
||||
use frame_support::traits::MigrateAccount;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
@@ -504,18 +503,6 @@ decl_module! {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Trait> MigrateAccount<T::AccountId> for Module<T> {
|
||||
fn migrate_account(a: &T::AccountId) {
|
||||
if let Some(v) = T::ValidatorIdOf::convert(a.clone()) {
|
||||
if let Some(keys) = NextKeys::<T>::migrate_key_from_blake(v) {
|
||||
for id in T::Keys::key_ids() {
|
||||
KeyOwner::<T>::migrate_key_from_blake((*id, keys.get_raw(*id)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Trait> Module<T> {
|
||||
/// Move on to next session. Register new validator set and session keys. Changes
|
||||
/// to the validator set have a session of delay to take effect. This allows for
|
||||
|
||||
@@ -179,7 +179,7 @@ impl frame_system::Trait for Test {
|
||||
type Version = ();
|
||||
type ModuleToIndex = ();
|
||||
type AccountData = ();
|
||||
type MigrateAccount = (); type OnNewAccount = ();
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = ();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user