diff --git a/runtime/acala/src/lib.rs b/runtime/acala/src/lib.rs index 33094098a..8f78efad1 100644 --- a/runtime/acala/src/lib.rs +++ b/runtime/acala/src/lib.rs @@ -1999,13 +1999,25 @@ pub type Executive = frame_executive::Executive< Migrations, >; -parameter_types! { - pub const XTokensPallet: &'static str = "XTokens"; - pub const MigrationStatus: &'static str = "MigrationStatus"; +pub struct RemoveXTokensMigrationStatus(frame_support::pallet_prelude::PhantomData); + +impl frame_support::traits::OnRuntimeUpgrade for RemoveXTokensMigrationStatus { + fn on_runtime_upgrade() -> Weight { + let key = frame_support::storage::storage_prefix(b"XTokens", b"MigrationStatus"); + log::info!( + "key: {:?}, exists: {:?}", + key, + frame_support::storage::unhashed::exists(&key) + ); + + frame_support::storage::unhashed::kill(&key); + + T::DbWeight::get().writes(1) + } } #[allow(unused_parens)] -type Migrations = (frame_support::migrations::RemoveStorage,); +type Migrations = (RemoveXTokensMigrationStatus); #[cfg(feature = "runtime-benchmarks")] #[macro_use] diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index d0738269e..929a98791 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -2006,13 +2006,25 @@ pub type Executive = frame_executive::Executive< Migrations, >; -parameter_types! { - pub const XTokensPallet: &'static str = "XTokens"; - pub const MigrationStatus: &'static str = "MigrationStatus"; +pub struct RemoveXTokensMigrationStatus(frame_support::pallet_prelude::PhantomData); + +impl frame_support::traits::OnRuntimeUpgrade for RemoveXTokensMigrationStatus { + fn on_runtime_upgrade() -> Weight { + let key = frame_support::storage::storage_prefix(b"XTokens", b"MigrationStatus"); + log::info!( + "key: {:?}, exists: {:?}", + key, + frame_support::storage::unhashed::exists(&key) + ); + + frame_support::storage::unhashed::kill(&key); + + T::DbWeight::get().writes(1) + } } #[allow(unused_parens)] -type Migrations = (frame_support::migrations::RemoveStorage,); +type Migrations = (RemoveXTokensMigrationStatus); #[cfg(feature = "runtime-benchmarks")] #[macro_use]