From 3396a70d8f5d03384c7d96fac7a0f89d29a221f5 Mon Sep 17 00:00:00 2001 From: Gavin Wood Date: Tue, 13 Dec 2022 12:48:37 +0000 Subject: [PATCH] Introduce migrations for inactive balances (#1943) * Introduce migrations * Introduce migrations * Bump Co-authored-by: joepetrowski --- cumulus/parachains/runtimes/assets/statemine/src/lib.rs | 8 +++++++- cumulus/parachains/runtimes/assets/statemint/src/lib.rs | 8 +++++++- cumulus/parachains/runtimes/assets/westmint/src/lib.rs | 8 +++++++- .../runtimes/collectives/collectives-polkadot/src/lib.rs | 6 +++++- .../runtimes/contracts/contracts-rococo/src/lib.rs | 8 +++++++- cumulus/parachains/runtimes/starters/seedling/src/lib.rs | 1 + cumulus/parachains/runtimes/testing/penpal/src/lib.rs | 4 ++++ 7 files changed, 38 insertions(+), 5 deletions(-) diff --git a/cumulus/parachains/runtimes/assets/statemine/src/lib.rs b/cumulus/parachains/runtimes/assets/statemine/src/lib.rs index 3f80c5da4a..3a108d668e 100644 --- a/cumulus/parachains/runtimes/assets/statemine/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/statemine/src/lib.rs @@ -636,6 +636,12 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +pub type Migrations = ( + pallet_balances::migration::MigrateToTrackInactive, + pallet_assets::migration::v1::MigrateToV1, +); + /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -643,7 +649,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - pallet_assets::migration::v1::MigrateToV1, + Migrations, >; #[cfg(feature = "runtime-benchmarks")] diff --git a/cumulus/parachains/runtimes/assets/statemint/src/lib.rs b/cumulus/parachains/runtimes/assets/statemint/src/lib.rs index 6ee0793f36..6400e71d72 100644 --- a/cumulus/parachains/runtimes/assets/statemint/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/statemint/src/lib.rs @@ -649,6 +649,12 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +pub type Migrations = ( + pallet_balances::migration::MigrateToTrackInactive, + pallet_assets::migration::v1::MigrateToV1, +); + /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -656,7 +662,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - pallet_assets::migration::v1::MigrateToV1, + Migrations, >; #[cfg(feature = "runtime-benchmarks")] diff --git a/cumulus/parachains/runtimes/assets/westmint/src/lib.rs b/cumulus/parachains/runtimes/assets/westmint/src/lib.rs index b339442538..2425837389 100644 --- a/cumulus/parachains/runtimes/assets/westmint/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/westmint/src/lib.rs @@ -609,6 +609,12 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +pub type Migrations = ( + pallet_balances::migration::MigrateToTrackInactive, + pallet_assets::migration::v1::MigrateToV1, +); + /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -616,7 +622,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - pallet_assets::migration::v1::MigrateToV1, + Migrations, >; #[cfg(feature = "runtime-benchmarks")] diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index a6c1b9d288..b37e9a6c73 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -550,6 +550,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; + /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -562,7 +563,10 @@ pub type Executive = frame_executive::Executive< // All migrations executed on runtime upgrade as a nested tuple of types implementing `OnRuntimeUpgrade`. // Included migrations must be idempotent. -type Migrations = (pallet_alliance::migration::Migration,); +type Migrations = ( + pallet_alliance::migration::Migration, + pallet_balances::migration::MigrateToTrackInactive, +); #[cfg(feature = "runtime-benchmarks")] #[macro_use] diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 0e5c7e67b7..ce18548d00 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -96,6 +96,12 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +pub type Migrations = ( + pallet_contracts::Migration, + pallet_balances::migration::MigrateToTrackInactive, +); + /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -103,7 +109,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - pallet_contracts::Migration, + Migrations, >; impl_opaque_keys! { diff --git a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs index c6dc99eab7..22a0fd3fe1 100644 --- a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs +++ b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs @@ -227,6 +227,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; + /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, diff --git a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs index 07ec07558a..d842e39ab8 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs @@ -125,6 +125,9 @@ pub type UncheckedExtrinsic = /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type Migrations = + (pallet_balances::migration::MigrateToTrackInactive,); + /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -132,6 +135,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, + Migrations, >; /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the