Skip to content

Commit

Permalink
Improve VersionedMigration naming conventions (paritytech#2264)
Browse files Browse the repository at this point in the history
As suggested by @ggwpez
(paritytech#2142 (comment)),
remove the `VersionChecked` prefix from version checked migrations (but
leave `VersionUnchecked` prefixes)

---------

Co-authored-by: command-bot <>
  • Loading branch information
liamaharon committed Nov 10, 2023
1 parent ad302e7 commit 47d5c10
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions substrate/frame/society/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,13 @@ impl<

/// [`VersionUncheckedMigrateToV2`] wrapped in a [`frame_support::migrations::VersionedMigration`],
/// ensuring the migration is only performed when on-chain version is 0.
pub type VersionCheckedMigrateToV2<T, I, PastPayouts> =
frame_support::migrations::VersionedMigration<
0,
2,
VersionUncheckedMigrateToV2<T, I, PastPayouts>,
crate::pallet::Pallet<T, I>,
<T as frame_system::Config>::DbWeight,
>;
pub type MigrateToV2<T, I, PastPayouts> = frame_support::migrations::VersionedMigration<
0,
2,
VersionUncheckedMigrateToV2<T, I, PastPayouts>,
crate::pallet::Pallet<T, I>,
<T as frame_system::Config>::DbWeight,
>;

pub(crate) mod old {
use super::*;
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/support/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use sp_std::marker::PhantomData;
/// // OnRuntimeUpgrade implementation...
/// }
///
/// pub type VersionCheckedMigrateV5ToV6<T, I> =
/// pub type MigrateV5ToV6<T, I> =
/// VersionedMigration<
/// 5,
/// 6,
Expand All @@ -63,7 +63,7 @@ use sp_std::marker::PhantomData;
/// // Migrations tuple to pass to the Executive pallet:
/// pub type Migrations = (
/// // other migrations...
/// VersionCheckedMigrateV5ToV6<T, ()>,
/// MigrateV5ToV6<T, ()>,
/// // other migrations...
/// );
/// ```
Expand Down

0 comments on commit 47d5c10

Please sign in to comment.