Skip to content

Commit

Permalink
chore: bump app version, add upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurist-85 committed Feb 19, 2024
1 parent f64f257 commit ac561a1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.2"
VERSION := "1.7.3"
CBFTVERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
Expand Down
7 changes: 7 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ import (
v170 "github.com/haqq-network/haqq/app/upgrades/v1.7.0"
v171 "github.com/haqq-network/haqq/app/upgrades/v1.7.1"
v172 "github.com/haqq-network/haqq/app/upgrades/v1.7.2"
v173 "github.com/haqq-network/haqq/app/upgrades/v1.7.3"

// NOTE: override ICS20 keeper to support IBC transfers of ERC20 tokens
"github.com/haqq-network/haqq/x/ibc/transfer"
Expand Down Expand Up @@ -1220,6 +1221,12 @@ func (app *Haqq) setupUpgradeHandlers() {
v172.CreateUpgradeHandler(app.mm, app.configurator),
)

// v1.7.3 Fix Liquid Vesting Module
app.UpgradeKeeper.SetUpgradeHandler(
v173.UpgradeName,
v173.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.
Expand Down
6 changes: 6 additions & 0 deletions app/upgrades/v1.7.3/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package v173

const (
// UpgradeName is the shared upgrade plan name for mainnet and testnet
UpgradeName = "v1.7.3"
)
20 changes: 20 additions & 0 deletions app/upgrades/v1.7.3/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package v173

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.7.3
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.7.3")

return mm.RunMigrations(ctx, configurator, vm)
}
}

0 comments on commit ac561a1

Please sign in to comment.