From 9ff225a9859731e9547966dbc7c41f23e00d6b36 Mon Sep 17 00:00:00 2001 From: Kevin Yang <5478483+k-yang@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:08:43 -0500 Subject: [PATCH] chore: add v1.4.0 upgrade handler --- app/upgrades.go | 2 ++ app/upgrades/v1_4_0/constants.go | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 app/upgrades/v1_4_0/constants.go diff --git a/app/upgrades.go b/app/upgrades.go index 562d67186..5b53d1f95 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -13,6 +13,7 @@ import ( "github.com/NibiruChain/nibiru/app/upgrades/v1_1_0" "github.com/NibiruChain/nibiru/app/upgrades/v1_2_0" "github.com/NibiruChain/nibiru/app/upgrades/v1_3_0" + "github.com/NibiruChain/nibiru/app/upgrades/v1_4_0" ) var Upgrades = []upgrades.Upgrade{ @@ -22,6 +23,7 @@ var Upgrades = []upgrades.Upgrade{ v1_1_0.Upgrade, v1_2_0.Upgrade, v1_3_0.Upgrade, + v1_4_0.Upgrade, } func (app *NibiruApp) setupUpgrades() { diff --git a/app/upgrades/v1_4_0/constants.go b/app/upgrades/v1_4_0/constants.go new file mode 100644 index 000000000..5043704eb --- /dev/null +++ b/app/upgrades/v1_4_0/constants.go @@ -0,0 +1,24 @@ +package v1_4_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" +) + +const UpgradeName = "v1.4.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{}, + }, +}