diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index f16c1da145..45e8ba1fe2 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -81,7 +81,7 @@ use sp_core::OpaqueMetadata; use sp_staking::SessionIndex; use frame_support::{ parameter_types, construct_runtime, RuntimeDebug, PalletId, - traits::{KeyOwnerProofSystem, LockIdentifier, Filter, InstanceFilter, All}, + traits::{KeyOwnerProofSystem, LockIdentifier, Filter, InstanceFilter, All, OnRuntimeUpgrade}, weights::Weight, }; use frame_system::{EnsureRoot, EnsureOneOf}; @@ -1525,11 +1525,22 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPallets, - RemoveCollectiveFlip, + (RemoveCollectiveFlip, MigratePalletVersionToStorageVersion), >; /// The payload being signed in the transactions. pub type SignedPayload = generic::SignedPayload; +/// Migrate from `PalletVersion` to the new `StorageVersion` +pub struct MigratePalletVersionToStorageVersion; + +impl OnRuntimeUpgrade for MigratePalletVersionToStorageVersion { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + frame_support::migrations::migrate_from_pallet_version_to_storage_version::( + &RocksDbWeight::get() + ) + } +} + pub struct RemoveCollectiveFlip; impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { fn on_runtime_upgrade() -> Weight { diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 213e54c806..22773c5d36 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -56,7 +56,7 @@ use sp_core::OpaqueMetadata; use sp_staking::SessionIndex; use frame_support::{ parameter_types, construct_runtime, RuntimeDebug, PalletId, - traits::{KeyOwnerProofSystem, LockIdentifier, Filter}, + traits::{KeyOwnerProofSystem, LockIdentifier, Filter, OnRuntimeUpgrade}, weights::Weight, }; use frame_system::{EnsureRoot, EnsureOneOf}; @@ -1088,11 +1088,22 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPallets, - RemoveCollectiveFlip, + (RemoveCollectiveFlip, MigratePalletVersionToStorageVersion), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; +/// Migrate from `PalletVersion` to the new `StorageVersion` +pub struct MigratePalletVersionToStorageVersion; + +impl OnRuntimeUpgrade for MigratePalletVersionToStorageVersion { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + frame_support::migrations::migrate_from_pallet_version_to_storage_version::( + &RocksDbWeight::get() + ) + } +} + pub struct RemoveCollectiveFlip; impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { fn on_runtime_upgrade() -> Weight {