Skip to content

Commit

Permalink
feat: bump ibc to v7.4.0 and add v4.1.5 handler (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 authored Apr 8, 2024
1 parent 0af69ef commit f38977a
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 74 deletions.
35 changes: 27 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ import (
appparams "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/params"

// unnamed import of statik for swagger UI support
v3_0_2 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v3_0_2"
v42 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_2"
v45 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_5"
"github.com/rakyll/statik/fs"

v4 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_4"

// unnamed import of statik for swagger UI support
_ "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/client/docs/statik"
)
Expand Down Expand Up @@ -1144,8 +1145,29 @@ func RegisterSwaggerAPI(rtr *mux.Router) {
// Setup Upgrade Handler
func (app *MigalooApp) setupUpgradeHandlers() {
app.UpgradeKeeper.SetUpgradeHandler(
v4.UpgradeName,
v4.CreateUpgradeHandler(
v3_0_2.UpgradeName,
v3_0_2.CreateUpgradeHandler(app.mm, app.configurator),
)

// !! ATTENTION !!
// v4 upgrade handler
// !! WHEN UPGRADING TO SDK v0.47 MAKE SURE TO INCLUDE THIS
// source: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/UPGRADING.md#xconsensus
app.UpgradeKeeper.SetUpgradeHandler(
v42.UpgradeName,
v42.CreateUpgradeHandler(
app.mm,
app.configurator,
app.IBCKeeper.ClientKeeper,
app.ParamsKeeper,
app.ConsensusParamsKeeper,
app.ICAControllerKeeper,
app.AccountKeeper,
),
)
app.UpgradeKeeper.SetUpgradeHandler(
v45.UpgradeName,
v45.CreateUpgradeHandler(
app.mm,
app.configurator,
),
Expand All @@ -1163,10 +1185,7 @@ func (app *MigalooApp) setupUpgradeHandlers() {
return
}

if upgradeInfo.Name == v4.UpgradeName {
// !! ATTENTION !!
// !! WHEN UPGRADING TO SDK v0.47 MAKE SURE TO INCLUDE THIS
// source: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/UPGRADING.md
if upgradeInfo.Name == v45.UpgradeName {
storeUpgrades := &storetypes.StoreUpgrades{
Added: []string{},
Deleted: []string{},
Expand Down
51 changes: 0 additions & 51 deletions app/upgrades/v4_1_3/upgrades.go

This file was deleted.

7 changes: 0 additions & 7 deletions app/upgrades/v4_1_4/constants.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v4

// UpgradeName defines the on-chain upgrade name for the Migaloo v4.1.2 upgrade.
// UpgradeName defines the on-chain upgrade name for the Migaloo v4.1.5 upgrade.
// this upgrade includes the fix for pfm
const (
UpgradeName = "v4.1.2"
UpgradeName = "v4.1.5"
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

// CreateUpgradeHandler that migrates the chain from v4.1.3 to v4.1.4
// CreateUpgradeHandler that migrates the chain from v4.1.2 to v4.1.5
func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/cosmos/cosmos-sdk v0.47.10
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017
github.com/cosmos/ibc-go/v7 v7.3.2
github.com/cosmos/ibc-go/v7 v7.4.0
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/prometheus/client_golang v1.18.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1 h1:02RCbih5lQ8aGdDMSvxhTn
github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1/go.mod h1:LvVkEXTORVgd87W2Yu7ZY3acKKeTMq/txdTworn8EZI=
github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017 h1:/m++TlQ4CfCZs+7vGFDQNdlnkvSNKFoLbjzmWOT7m10=
github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017/go.mod h1:JwHFbo1oX/ht4fPpnPvmhZr+dCkYK1Vihw+vZE9umR4=
github.com/cosmos/ibc-go/v7 v7.3.2 h1:FeUDcBX7VYY0e0iRmcVkPPUjYfAqIc//QuHXo8JHz9c=
github.com/cosmos/ibc-go/v7 v7.3.2/go.mod h1:IMeOXb7gwpZ+/nOG5BuUkdW4weM1ezvN4PQPws4uzOI=
github.com/cosmos/ibc-go/v7 v7.4.0 h1:8FqYMptvksgMvlbN4UW9jFxTXzsPyfAzEZurujXac8M=
github.com/cosmos/ibc-go/v7 v7.4.0/go.mod h1:L/KaEhzV5TGUCTfGysVgMBQtl5Dm7hHitfpk+GIeoAo=
github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=
github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0=
github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo=
Expand Down
4 changes: 2 additions & 2 deletions scripts/upgrade_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# the upgrade is a fork, "true" otherwise
FORK=${FORK:-"false"}

OLD_VERSION=v4.1.3
OLD_VERSION=v4.1.4
UPGRADE_WAIT=${UPGRADE_WAIT:-20}
HOME=mytestnet
ROOT=$(pwd)
DENOM=uwhale
CHAIN_ID=localmigaloo
SOFTWARE_UPGRADE_NAME="v4.1.4"
SOFTWARE_UPGRADE_NAME="v4.1.5"
ADDITIONAL_PRE_SCRIPTS=${ADDITIONAL_PRE_SCRIPTS:-""}
ADDITIONAL_AFTER_SCRIPTS=${ADDITIONAL_AFTER_SCRIPTS:-""}

Expand Down

0 comments on commit f38977a

Please sign in to comment.