Skip to content

Commit

Permalink
fix migrator and create upgrade handler (#1454)
Browse files Browse the repository at this point in the history
Co-authored-by: Yarom Swisa <[email protected] git config --global user.name Yarom>
  • Loading branch information
Yaroms and Yarom Swisa authored May 31, 2024
1 parent ca1d93d commit c0a6a5c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ var Upgrades = []upgrades.Upgrade{
upgrades.Upgrade_1_2_0,
upgrades.Upgrade_2_0_0,
upgrades.Upgrade_2_1_0,
upgrades.Upgrade_2_1_1,
}

// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals
Expand Down
6 changes: 6 additions & 0 deletions app/upgrades/empty_upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,9 @@ var Upgrade_2_1_0 = Upgrade{
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_2_1_1 = Upgrade{
UpgradeName: "v2.1.1",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}
2 changes: 1 addition & 1 deletion x/epochstorage/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
}

// register v6 -> v7 migration
if err := cfg.RegisterMigration(types.ModuleName, 6, migrator.Migrate5to6); err != nil {
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))
}
Expand Down

0 comments on commit c0a6a5c

Please sign in to comment.