Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Remove SlotsCrowdloanIndexMigration & InjectValidatorsIntoVoterList #5374

Merged
merged 12 commits into from
Apr 25, 2022
25 changes: 2 additions & 23 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1531,31 +1530,11 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(
SlotsCrowdloanIndexMigration,
pallet_staking::migrations::v9::InjectValidatorsIntoVoterList<Runtime>,
),
(),
>;
/// The payload being signed in the transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;

pub struct SlotsCrowdloanIndexMigration;
impl OnRuntimeUpgrade for SlotsCrowdloanIndexMigration {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
slots::migration::slots_crowdloan_index_migration::migrate::<Runtime>()
}

#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
slots::migration::slots_crowdloan_index_migration::pre_migrate::<Runtime>()
}

#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
slots::migration::slots_crowdloan_index_migration::post_migrate::<Runtime>()
}
}

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
Expand Down
26 changes: 2 additions & 24 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1484,32 +1483,11 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(
SlotsCrowdloanIndexMigration,
pallet_staking::migrations::v9::InjectValidatorsIntoVoterList<Runtime>,
),
(),
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;

// 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::<Runtime>()
}

#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
slots::migration::slots_crowdloan_index_migration::pre_migrate::<Runtime>()
}

#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
slots::migration::slots_crowdloan_index_migration::post_migrate::<Runtime>()
}
}

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
Expand Down
25 changes: 2 additions & 23 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -1093,32 +1093,11 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(
SlotsCrowdloanIndexMigration,
pallet_staking::migrations::v9::InjectValidatorsIntoVoterList<Runtime>,
),
(),
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;

// 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::<Runtime>()
}

#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
slots::migration::slots_crowdloan_index_migration::pre_migrate::<Runtime>()
}

#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
slots::migration::slots_crowdloan_index_migration::post_migrate::<Runtime>()
}
}

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
Expand Down