Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
9 changes: 2 additions & 7 deletions pallets/delegation/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<T: Config> VersionMigratorTrait<T> for DelegationStorageVersion {
fn pre_migrate(&self) -> Result<(), &str> {
match *self {
Self::V1 => v1::pre_migrate::<T>(),
Self::V2 => Err("Already latest v2 version."),
Self::V2 => Ok(()),
}
}

Expand All @@ -76,7 +76,7 @@ impl<T: Config> VersionMigratorTrait<T> for DelegationStorageVersion {
fn post_migrate(&self) -> Result<(), &str> {
match *self {
Self::V1 => v1::post_migrate::<T>(),
Self::V2 => Err("Migration from v2 should have never happened in the first place."),
Self::V2 => Ok(()),
}
}
}
Expand Down Expand Up @@ -104,11 +104,6 @@ impl<T: Config> DelegationStorageMigrator<T> {
/// latest possible.
#[cfg(feature = "try-runtime")]
pub(crate) fn pre_migrate() -> Result<(), &'static str> {
ensure!(
StorageVersion::<T>::get() < DelegationStorageVersion::latest(),
"Already the latest storage version."
);

// Don't need to check for any other pre_migrate, as in try-runtime it is also
// called in the migrate() function. Same applies for post_migrate checks for
// each version migrator.
Expand Down
9 changes: 2 additions & 7 deletions pallets/did/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<T: Config> VersionMigratorTrait<T> for DidStorageVersion {
fn pre_migrate(&self) -> Result<(), &str> {
match *self {
Self::V1 => v1::pre_migrate::<T>(),
Self::V2 => Err("Already latest v2 version."),
Self::V2 => Ok(()),
}
}

Expand All @@ -76,7 +76,7 @@ impl<T: Config> VersionMigratorTrait<T> for DidStorageVersion {
fn post_migrate(&self) -> Result<(), &str> {
match *self {
Self::V1 => v1::post_migrate::<T>(),
Self::V2 => Err("Migration from v2 should have never happened in the first place."),
Self::V2 => Ok(()),
}
}
}
Expand Down Expand Up @@ -104,11 +104,6 @@ impl<T: Config> DidStorageMigrator<T> {
/// latest possible.
#[cfg(feature = "try-runtime")]
pub(crate) fn pre_migrate() -> Result<(), &'static str> {
ensure!(
StorageVersion::<T>::get() < DidStorageVersion::latest(),
"Already the latest storage version."
);

// Don't need to check for any other pre_migrate, as in try-runtime it is also
// called in the migrate() function. Same applies for post_migrate checks for
// each version migrator.
Expand Down
Loading