From 09067e96a9223b32e1641bb555f6acdfd7361a7a Mon Sep 17 00:00:00 2001 From: Kevin Yang <5478483+k-yang@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:33:26 -0500 Subject: [PATCH 1/2] fix: upgrade handler for v1.1.0 --- app/upgrades.go | 2 +- app/upgrades/types.go | 3 ++- app/upgrades/v1_1_0/constants.go | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index 4a863d0aa..8487b5f22 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -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)) } } diff --git a/app/upgrades/types.go b/app/upgrades/types.go index caa328bb8..a2cdde4b5 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -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 } diff --git a/app/upgrades/v1_1_0/constants.go b/app/upgrades/v1_1_0/constants.go index 9a384e5b5..257ef77c5 100644 --- a/app/upgrades/v1_1_0/constants.go +++ b/app/upgrades/v1_1_0/constants.go @@ -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" @@ -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}, From e0c93a7a635999ca5717e0aec558e83cd5c3646d Mon Sep 17 00:00:00 2001 From: Kevin Yang <5478483+k-yang@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:36:58 -0500 Subject: [PATCH 2/2] chore: update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9afbd93d8..48acbb845 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1688](https://github.com/NibiruChain/nibiru/pull/1688) - fix(inflation)!: make default inflation allocation follow tokenomics * [#1682](https://github.com/NibiruChain/nibiru/pull/1682) - feat!: add upgrade handler for v1.1.0 +* [#1706](https://github.com/NibiruChain/nibiru/pull/706) - fix: `v1.1.0` upgrade handler #### Dapp modules: perp, spot, etc @@ -77,7 +78,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Bump `golang` from 1.19 to 1.21 ([#1698](https://github.com/NibiruChain/nibiru/pull/1698)) * [#1678](https://github.com/NibiruChain/nibiru/pull/1678) - chore(deps): collections to v0.4.0 for math.Int value encoder - ## [v1.1.0] - 2023-11-20 * [[Release Link](https://github.com/NibiruChain/nibiru/releases/tag/v1.1.0)]