diff --git a/parachain/runtime/paseo/src/lib.rs b/parachain/runtime/paseo/src/lib.rs index 8a6c26dcda..107e9cfc55 100644 --- a/parachain/runtime/paseo/src/lib.rs +++ b/parachain/runtime/paseo/src/lib.rs @@ -159,7 +159,7 @@ pub type Executive = frame_executive::Executive< // it was reverse order before. // See the comment before collation related pallets too. AllPalletsWithSystem, - migration::MigrateStorageVersionPatch, + migration::Migrations, >; impl fp_self_contained::SelfContainedCall for RuntimeCall { diff --git a/parachain/runtime/paseo/src/migration/mod.rs b/parachain/runtime/paseo/src/migration/mod.rs index 0f7ebb850e..29bce4d298 100644 --- a/parachain/runtime/paseo/src/migration/mod.rs +++ b/parachain/runtime/paseo/src/migration/mod.rs @@ -28,52 +28,17 @@ // In try-runtime, current implementation, the storage version is not checked, // Pallet version is used instead. -use frame_support::traits::OnRuntimeUpgrade; -use sp_std::marker::PhantomData; - -pub struct MigrateStorageVersionPatch(PhantomData); -impl OnRuntimeUpgrade for MigrateStorageVersionPatch -where - T: frame_system::Config - + cumulus_pallet_xcmp_queue::Config - + cumulus_pallet_xcmp_queue::migration::v5::V5Config, -{ - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { - // Only checking the lowest storage version - let xcmp_queue_storage_version_check = - cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4::::pre_upgrade()?; - - Ok(VersionedPostUpgradeData::MigrationExecuted(Inner::pre_upgrade()?).encode()) - } - - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let mut weight = frame_support::weights::Weight::from_parts(0, 0); - // V3 to V4 - // XCMP QueueConfig has different default value - // Migration targeting at changing storage value to new default value if old value matched - // Our current Paseo setting has already hard-coded - // This migration should have no effect except bumping storage version - weight += - cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4::::on_runtime_upgrade(); - // V4 to V5 - // Did nothing to storage - // Just checking MaxActiveOutboundChannels is not exceeded - // Our current Paseo Storage is 0 - // This migration should have no effect except bumping storage version - weight += - cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5::::on_runtime_upgrade(); - - weight - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade( - versioned_post_upgrade_data_bytes: alloc::vec::Vec, - ) -> Result<(), sp_runtime::TryRuntimeError> { - // Only checking the lowest storage version - cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4::::post_upgrade( - versioned_post_upgrade_data_bytes, - ) - } -} +pub type Migrations = ( + // V3 to V4 + // XCMP QueueConfig has different default value + // Migration targeting at changing storage value to new default value if old value matched + // Our current Paseo setting has already hard-coded + // This migration should have no effect except bumping storage version + cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, + // V4 to V5 + // Did nothing to storage + // Just checking MaxActiveOutboundChannels is not exceeded + // Our current Paseo Storage is 0 + // This migration should have no effect except bumping storage version + cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, +); \ No newline at end of file