From 596088a273eff13fbefe6fa20a5fef6507b329cb Mon Sep 17 00:00:00 2001 From: Bruno Galvao <brunopgalvao@gmail.com> Date: Fri, 17 Nov 2023 01:31:31 -0500 Subject: [PATCH] add pallet nomination-pools versioned migration to kitchensink (#2167) The versioned migrations are already there in pallet nomination-pools: https://github.com/paritytech/polkadot-sdk/blob/f6ee4781f633f0f89598f7b230595afe401da8dc/substrate/frame/nomination-pools/src/migration.rs#L27-L48 Just updating the kitchensink runtime to point to them. This is also nice because it points the dev to an example of how to use `VersionedMigration`. --- polkadot/runtime/westend/src/lib.rs | 4 ++-- substrate/bin/node/runtime/src/lib.rs | 5 +++-- substrate/frame/nomination-pools/src/migration.rs | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 16a0b112a0b..29183fdfe00 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -1533,9 +1533,9 @@ pub mod migrations { parachains_configuration::migration::v8::MigrateToV8<Runtime>, parachains_configuration::migration::v9::MigrateToV9<Runtime>, paras_registrar::migration::MigrateToV1<Runtime, ()>, - pallet_nomination_pools::migration::versioned_migrations::V5toV6<Runtime>, + pallet_nomination_pools::migration::versioned::V5toV6<Runtime>, pallet_referenda::migration::v1::MigrateV0ToV1<Runtime, ()>, - pallet_nomination_pools::migration::versioned_migrations::V6ToV7<Runtime>, + pallet_nomination_pools::migration::versioned::V6ToV7<Runtime>, pallet_grandpa::migrations::MigrateV4ToV5<Runtime>, parachains_configuration::migration::v10::MigrateToV10<Runtime>, ); diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 90946b71311..d7beb29becf 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -2194,9 +2194,10 @@ pub type Executive = frame_executive::Executive< >; // All migrations executed on runtime upgrade as a nested tuple of types implementing -// `OnRuntimeUpgrade`. +// `OnRuntimeUpgrade`. Note: These are examples and do not need to be run directly +// after the genesis block. type Migrations = ( - pallet_nomination_pools::migration::v2::MigrateToV2<Runtime>, + pallet_nomination_pools::migration::versioned::V6ToV7<Runtime>, pallet_alliance::migration::Migration<Runtime>, pallet_contracts::Migration<Runtime>, ); diff --git a/substrate/frame/nomination-pools/src/migration.rs b/substrate/frame/nomination-pools/src/migration.rs index eef2a976f1a..3d68fee1dca 100644 --- a/substrate/frame/nomination-pools/src/migration.rs +++ b/substrate/frame/nomination-pools/src/migration.rs @@ -24,7 +24,7 @@ use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; use sp_runtime::TryRuntimeError; /// Exports for versioned migration `type`s for this pallet. -pub mod versioned_migrations { +pub mod versioned { use super::*; /// Migration V6 to V7 wrapped in a [`frame_support::migrations::VersionedMigration`], ensuring -- GitLab