Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(frame_support::pallet_prelude::PhantomData<T>);

impl<T: frame_system::Config> frame_support::traits::OnRuntimeUpgrade for RemoveXTokensMigrationStatus<T> {
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<XTokensPallet, MigrationStatus, RocksDbWeight>,);
type Migrations = (RemoveXTokensMigrationStatus<Runtime>);

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
Expand Down
20 changes: 16 additions & 4 deletions runtime/karura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(frame_support::pallet_prelude::PhantomData<T>);

impl<T: frame_system::Config> frame_support::traits::OnRuntimeUpgrade for RemoveXTokensMigrationStatus<T> {
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<XTokensPallet, MigrationStatus, RocksDbWeight>,);
type Migrations = (RemoveXTokensMigrationStatus<Runtime>);

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
Expand Down