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

Remove SlotsCrowdloanIndexMigration & InjectValidatorsIntoVoterList (#5374) #5379

Merged
merged 1 commit into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1536,31 +1535,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 @@ -1489,32 +1488,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 @@ -1098,32 +1098,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