From b01d53982e5a0ac2affc01f9fdbd9843a2a5518f Mon Sep 17 00:00:00 2001 From: Mara Robin B Date: Mon, 25 Apr 2022 10:58:52 +0200 Subject: [PATCH] Remove SlotsCrowdloanIndexMigration & InjectValidatorsIntoVoterList (#5374) * Remove SlotsCrowdloanIndexMigration * Remove slots index migration code * Remove crowdloan index migration code * remove reference to migration * rustfmt * westend: remove unused import OnRuntimeUpgrade * kusama: remove unused import OnRuntimeUpgrade * polkadot: remove unused import OnRuntimeUpgrade * Revert "Remove crowdloan index migration code" This reverts commit fe84b59e3133e950740d911fb019e6002f60d5a3. * Revert "Remove slots index migration code" This reverts commit 62c5a28e21d2949189bdb52835cc3a44f6e9c561. * Revert "remove reference to migration" This reverts commit 1f8806c010210b638cc59979ab873619910596c0. * Remove InjectValidatorsIntoVoterList migration --- runtime/kusama/src/lib.rs | 25 ++----------------------- runtime/polkadot/src/lib.rs | 26 ++------------------------ runtime/westend/src/lib.rs | 25 ++----------------------- 3 files changed, 6 insertions(+), 70 deletions(-) diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 80eb6f905e07..7283daf2b86b 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -52,8 +52,7 @@ use frame_election_provider_support::{ use frame_support::{ construct_runtime, parameter_types, traits::{ - Contains, EnsureOneOf, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, - OnRuntimeUpgrade, PrivilegeCmp, + Contains, EnsureOneOf, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, PrivilegeCmp, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -1536,31 +1535,11 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - SlotsCrowdloanIndexMigration, - pallet_staking::migrations::v9::InjectValidatorsIntoVoterList, - ), + (), >; /// The payload being signed in the transactions. pub type SignedPayload = generic::SignedPayload; -pub struct SlotsCrowdloanIndexMigration; -impl OnRuntimeUpgrade for SlotsCrowdloanIndexMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - slots::migration::slots_crowdloan_index_migration::migrate::() - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - slots::migration::slots_crowdloan_index_migration::pre_migrate::() - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - slots::migration::slots_crowdloan_index_migration::post_migrate::() - } -} - #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking; diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 61e23e638d6f..cf9963acfb96 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -41,8 +41,7 @@ use frame_election_provider_support::{generate_solution_type, onchain, Sequentia use frame_support::{ construct_runtime, parameter_types, traits::{ - Contains, EnsureOneOf, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, - OnRuntimeUpgrade, PrivilegeCmp, + Contains, EnsureOneOf, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, PrivilegeCmp, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -1489,32 +1488,11 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - SlotsCrowdloanIndexMigration, - pallet_staking::migrations::v9::InjectValidatorsIntoVoterList, - ), + (), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; -// Migration for crowdloan pallet to use fund index for account generation. -pub struct SlotsCrowdloanIndexMigration; -impl OnRuntimeUpgrade for SlotsCrowdloanIndexMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - slots::migration::slots_crowdloan_index_migration::migrate::() - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - slots::migration::slots_crowdloan_index_migration::pre_migrate::() - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - slots::migration::slots_crowdloan_index_migration::post_migrate::() - } -} - #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking; diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 30bede43781e..44ac80bf3adf 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -25,7 +25,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{Contains, InstanceFilter, KeyOwnerProofSystem, OnRuntimeUpgrade}, + traits::{Contains, InstanceFilter, KeyOwnerProofSystem}, weights::ConstantMultiplier, PalletId, }; @@ -1098,32 +1098,11 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - SlotsCrowdloanIndexMigration, - pallet_staking::migrations::v9::InjectValidatorsIntoVoterList, - ), + (), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; -// Migration for crowdloan pallet to use fund index for account generation. -pub struct SlotsCrowdloanIndexMigration; -impl OnRuntimeUpgrade for SlotsCrowdloanIndexMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - slots::migration::slots_crowdloan_index_migration::migrate::() - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - slots::migration::slots_crowdloan_index_migration::pre_migrate::() - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - slots::migration::slots_crowdloan_index_migration::post_migrate::() - } -} - #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking;