Skip to content

Commit

Permalink
register old epochstorage migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
oren-lava committed Aug 14, 2024
1 parent b87b92f commit 535dc18
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions x/epochstorage/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {

migrator := keeper.NewMigrator(am.keeper)

// register v5 -> v6 migration
if err := cfg.RegisterMigration(types.ModuleName, 5, migrator.Migrate5to6); err != nil {
// panic:ok: at start up, migration cannot proceed anyhow
panic(fmt.Errorf("%s: failed to register migration to v6: %w", types.ModuleName, err))
}

// register v6 -> v7 migration
if err := cfg.RegisterMigration(types.ModuleName, 6, migrator.Migrate6to7); err != nil {
// panic:ok: at start up, migration cannot proceed anyhow
panic(fmt.Errorf("%s: failed to register migration to v7: %w", types.ModuleName, err))
}

// register v7 -> v8 migration
if err := cfg.RegisterMigration(types.ModuleName, 7, migrator.Migrate7to8); err != nil {
// panic:ok: at start up, migration cannot proceed anyhow
Expand Down

0 comments on commit 535dc18

Please sign in to comment.