From dfda1a34a9ac4c821dcd93743d8d6273e2b7a948 Mon Sep 17 00:00:00 2001 From: Yuri Surbashev Date: Thu, 17 Oct 2024 20:33:43 +0800 Subject: [PATCH] chore: prepare upgrade handler and bump app version --- Makefile | 2 +- app/app.go | 7 +++++++ app/upgrades/v1.8.2/constants.go | 6 ++++++ app/upgrades/v1.8.2/upgrades.go | 20 ++++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 app/upgrades/v1.8.2/constants.go create mode 100644 app/upgrades/v1.8.2/upgrades.go diff --git a/Makefile b/Makefile index 3be20ba8..bf7c3b74 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ DIFF_TAG=$(shell git rev-list --tags="v*" --max-count=1 --not $(shell git rev-li DEFAULT_TAG=$(shell git rev-list --tags="v*" --max-count=1) # VERSION ?= $(shell echo $(shell git describe --tags $(or $(DIFF_TAG), $(DEFAULT_TAG))) | sed 's/^v//') -VERSION := "1.8.1" +VERSION := "1.8.2" CBFTVERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') COMMIT := $(shell git log -1 --format='%H') LEDGER_ENABLED ?= true diff --git a/app/app.go b/app/app.go index 2f52ccae..2bc330ab 100644 --- a/app/app.go +++ b/app/app.go @@ -175,6 +175,7 @@ import ( v178 "github.com/haqq-network/haqq/app/upgrades/v1.7.8" v180 "github.com/haqq-network/haqq/app/upgrades/v1.8.0" v181 "github.com/haqq-network/haqq/app/upgrades/v1.8.1" + v182 "github.com/haqq-network/haqq/app/upgrades/v1.8.2" // NOTE: override ICS20 keeper to support IBC transfers of ERC20 tokens "github.com/haqq-network/haqq/x/ibc/transfer" @@ -1288,6 +1289,12 @@ func (app *Haqq) setupUpgradeHandlers(keys map[string]*storetypes.KVStoreKey) { v181.CreateUpgradeHandler(app.mm, app.configurator, app.AccountKeeper, *app.StakingKeeper.Keeper), ) + // v1.8.2 Add partial transfer ownership in UC DAO module, improve integration tests and fix IBC Forwarding + app.UpgradeKeeper.SetUpgradeHandler( + v182.UpgradeName, + v182.CreateUpgradeHandler(app.mm, app.configurator), + ) + // When a planned update height is reached, the old binary will panic // writing on disk the height and name of the update that triggered it // This will read that value, and execute the preparations for the upgrade. diff --git a/app/upgrades/v1.8.2/constants.go b/app/upgrades/v1.8.2/constants.go new file mode 100644 index 00000000..c11b65ff --- /dev/null +++ b/app/upgrades/v1.8.2/constants.go @@ -0,0 +1,6 @@ +package v182 + +const ( + // UpgradeName is the shared upgrade plan name for mainnet + UpgradeName = "v1.8.2" +) diff --git a/app/upgrades/v1.8.2/upgrades.go b/app/upgrades/v1.8.2/upgrades.go new file mode 100644 index 00000000..886fe3fb --- /dev/null +++ b/app/upgrades/v1.8.2/upgrades.go @@ -0,0 +1,20 @@ +package v182 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +// CreateUpgradeHandler creates an SDK upgrade handler for v1.8.2 +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + logger := ctx.Logger() + logger.Info("run migration v1.8.2") + + return mm.RunMigrations(ctx, configurator, vm) + } +}