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

Commit

Permalink
Remove SlotsCrowdloanIndexMigration & InjectValidatorsIntoVoterList (#…
Browse files Browse the repository at this point in the history
…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 fe84b59.

* Revert "Remove slots index migration code"

This reverts commit 62c5a28.

* Revert "remove reference to migration"

This reverts commit 1f8806c.

* Remove InjectValidatorsIntoVoterList migration
  • Loading branch information
coderobe committed Apr 25, 2022
1 parent 7fb297c commit b01d539
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 70 deletions.
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

0 comments on commit b01d539

Please sign in to comment.