Custom Slots Migration for Fund Index Change (#5227)

* new migration

* use new migration in runtime
This commit is contained in:
Shawn Tabrizi
2022-04-07 10:51:37 -04:00
committed by GitHub
parent 8db1b341e5
commit 4d837bac88
6 changed files with 117 additions and 19 deletions
+6 -6
View File
@@ -1086,7 +1086,7 @@ pub type Executive = frame_executive::Executive<
Runtime,
AllPalletsWithSystem,
(
CrowdloanIndexMigration,
SlotsCrowdloanIndexMigration,
pallet_staking::migrations::v9::InjectValidatorsIntoVoterList<Runtime>,
),
>;
@@ -1094,20 +1094,20 @@ pub type Executive = frame_executive::Executive<
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
// Migration for crowdloan pallet to use fund index for account generation.
pub struct CrowdloanIndexMigration;
impl OnRuntimeUpgrade for CrowdloanIndexMigration {
pub struct SlotsCrowdloanIndexMigration;
impl OnRuntimeUpgrade for SlotsCrowdloanIndexMigration {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
crowdloan::migration::crowdloan_index_migration::migrate::<Runtime>()
slots::migration::slots_crowdloan_index_migration::migrate::<Runtime>()
}
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
crowdloan::migration::crowdloan_index_migration::pre_migrate::<Runtime>()
slots::migration::slots_crowdloan_index_migration::pre_migrate::<Runtime>()
}
#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
crowdloan::migration::crowdloan_index_migration::post_migrate::<Runtime>()
slots::migration::slots_crowdloan_index_migration::post_migrate::<Runtime>()
}
}