diff --git a/app/app.go b/app/app.go index 55f9c977..9be55b4d 100644 --- a/app/app.go +++ b/app/app.go @@ -159,6 +159,7 @@ import ( 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" v46 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_6" + v47 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_7" "github.com/rakyll/statik/fs" // unnamed import of statik for swagger UI support @@ -1182,6 +1183,14 @@ func (app *MigalooApp) setupUpgradeHandlers() { ), ) + app.UpgradeKeeper.SetUpgradeHandler( + v47.UpgradeName, + v47.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/v4_1_7/constants.go b/app/upgrades/v4_1_7/constants.go new file mode 100644 index 00000000..9bb9ac25 --- /dev/null +++ b/app/upgrades/v4_1_7/constants.go @@ -0,0 +1,7 @@ +package v4 + +// 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.7" +) diff --git a/app/upgrades/v4_1_7/upgrades.go b/app/upgrades/v4_1_7/upgrades.go new file mode 100644 index 00000000..efd3c63d --- /dev/null +++ b/app/upgrades/v4_1_7/upgrades.go @@ -0,0 +1,17 @@ +package v4 + +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 that migrates the chain from v4.1.5 to v4.1.6 +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, configurator, fromVM) + } +} diff --git a/scripts/upgrade_test.sh b/scripts/upgrade_test.sh index a32be54e..283338a7 100755 --- a/scripts/upgrade_test.sh +++ b/scripts/upgrade_test.sh @@ -3,13 +3,13 @@ # the upgrade is a fork, "true" otherwise FORK=${FORK:-"false"} -OLD_VERSION=v4.1.5 +OLD_VERSION=v4.1.3 UPGRADE_WAIT=${UPGRADE_WAIT:-20} HOME=mytestnet ROOT=$(pwd) DENOM=uwhale CHAIN_ID=localmigaloo -SOFTWARE_UPGRADE_NAME="v4.1.6" +SOFTWARE_UPGRADE_NAME="v4.1.7" ADDITIONAL_PRE_SCRIPTS=${ADDITIONAL_PRE_SCRIPTS:-""} ADDITIONAL_AFTER_SCRIPTS=${ADDITIONAL_AFTER_SCRIPTS:-""}