Skip to content

Commit

Permalink
fix: upgrade handler for v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yang committed Dec 13, 2023
1 parent 32de025 commit 09067e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (app *NibiruApp) setupUpgrades() {

func (app *NibiruApp) setUpgradeHandlers() {
for _, u := range Upgrades {
app.upgradeKeeper.SetUpgradeHandler(u.UpgradeName, u.CreateUpgradeHandler())
app.upgradeKeeper.SetUpgradeHandler(u.UpgradeName, u.CreateUpgradeHandler(app.mm, app.configurator))
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package upgrades

import (
store "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

type Upgrade struct {
UpgradeName string

CreateUpgradeHandler func() types.UpgradeHandler
CreateUpgradeHandler func(*module.Manager, module.Configurator) types.UpgradeHandler

StoreUpgrades store.StoreUpgrades
}
8 changes: 6 additions & 2 deletions app/upgrades/v1_1_0/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package v1_1_0

import (
"github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/NibiruChain/nibiru/app/upgrades"
Expand All @@ -12,8 +14,10 @@ const UpgradeName = "v1.1.0"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: func() upgradetypes.UpgradeHandler {
return nil
CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, cfg, fromVM)
}
},
StoreUpgrades: types.StoreUpgrades{
Added: []string{inflationtypes.ModuleName},
Expand Down

0 comments on commit 09067e9

Please sign in to comment.