Skip to content

Commit

Permalink
fix: migration V15 for devnet #598
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanVerstraete committed Feb 6, 2023
1 parent 94a1357 commit e87586d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions substrate-node/pallets/pallet-tfgrid/src/migrations/v15.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ impl<T: Config> OnRuntimeUpgrade for MigrateTwinsV15<T> {

fn on_runtime_upgrade() -> Weight {
if PalletVersion::<T>::get() == types::StorageVersion::V14Struct {
migrate_twins::<T>()
// Comment for now to fix devnet storage version
// migrate_twins::<T>()

// Set correct storage version
PalletVersion::<T>::set(types::StorageVersion::V15Struct);
info!(" <<< Storage version upgraded to V15");
Weight::zero()
} else {
info!(" >>> Unused TFGrid pallet V15 migration");
Weight::zero()
Expand Down Expand Up @@ -79,7 +85,7 @@ pub fn migrate_twins<T: Config>() -> frame_support::weights::Weight {
});

// Update pallet storage version
PalletVersion::<T>::set(types::StorageVersion::V14Struct);
PalletVersion::<T>::set(types::StorageVersion::V15Struct);
info!(" <<< Twin migration success, storage version upgraded");

// Return the weight consumed by the migration.
Expand Down

0 comments on commit e87586d

Please sign in to comment.