Skip to content

Commit

Permalink
Migrate PalletVersion to StorageVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
icodezjb committed Feb 8, 2022
1 parent 59b36b5 commit 99f71bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,11 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
(RemoveCollectiveFlip, PhragmenElectionDepositRuntimeUpgrade),
(
RemoveCollectiveFlip,
MigratePalletVersionToStorageVersion,
PhragmenElectionDepositRuntimeUpgrade,
),
>;

impl_runtime_apis! {
Expand Down
10 changes: 10 additions & 0 deletions runtime/dev/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip {
}
}

/// Migrate from `PalletVersion` to the new `StorageVersion`
pub struct MigratePalletVersionToStorageVersion;
impl frame_support::traits::OnRuntimeUpgrade for MigratePalletVersionToStorageVersion {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
frame_support::migrations::migrate_from_pallet_version_to_storage_version::<
AllPalletsWithSystem,
>(&RocksDbWeight::get())
}
}

// 10 PCX
const OLD_CANDIDACY_BOND: Balance = 1000 * DOLLARS;
// 10 mPCX
Expand Down

0 comments on commit 99f71bb

Please sign in to comment.