Skip to content

Commit

Permalink
feat: add v2.0.0 upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yang committed Aug 19, 2024
1 parent 4b47ad3 commit 3e27632
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/NibiruChain/nibiru/v2/app/upgrades/v1_3_0"
"github.com/NibiruChain/nibiru/v2/app/upgrades/v1_4_0"
"github.com/NibiruChain/nibiru/v2/app/upgrades/v1_5_0"
"github.com/NibiruChain/nibiru/v2/app/upgrades/v2_0_0"
)

var Upgrades = []upgrades.Upgrade{
Expand All @@ -25,6 +26,7 @@ var Upgrades = []upgrades.Upgrade{
v1_3_0.Upgrade,
v1_4_0.Upgrade,
v1_5_0.Upgrade,
v2_0_0.Upgrade,
}

func (app *NibiruApp) setupUpgrades() {
Expand Down
25 changes: 25 additions & 0 deletions app/upgrades/v2_0_0/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package v2_0_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/v2/app/upgrades"
evmtypes "github.com/NibiruChain/nibiru/v2/x/evm"
)

const UpgradeName = "v2.0.0"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
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{evmtypes.ModuleName},
},
}

0 comments on commit 3e27632

Please sign in to comment.