From b06d49f7c07172abb99b16053cdbdc2bb0e9de42 Mon Sep 17 00:00:00 2001 From: StrathCole <7449529+StrathCole@users.noreply.github.com> Date: Thu, 5 Sep 2024 17:54:37 +0200 Subject: [PATCH] Backport GL wasmd patch to 3.1.3/3.1.4 (#513) --- app/app.go | 2 ++ app/upgrades/v8_2/constants.go | 13 +++++++++++++ app/upgrades/v8_2/upgrades.go | 21 +++++++++++++++++++++ contrib/updates/prepare_cosmovisor.sh | 2 +- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 app/upgrades/v8_2/constants.go create mode 100644 app/upgrades/v8_2/upgrades.go diff --git a/app/app.go b/app/app.go index 823d41c85..88268476a 100644 --- a/app/app.go +++ b/app/app.go @@ -56,6 +56,7 @@ import ( v7_1 "github.com/classic-terra/core/v3/app/upgrades/v7_1" v8 "github.com/classic-terra/core/v3/app/upgrades/v8" v8_1 "github.com/classic-terra/core/v3/app/upgrades/v8_1" + v8_2 "github.com/classic-terra/core/v3/app/upgrades/v8_2" customante "github.com/classic-terra/core/v3/custom/auth/ante" custompost "github.com/classic-terra/core/v3/custom/auth/post" @@ -87,6 +88,7 @@ var ( v7_1.Upgrade, v8.Upgrade, v8_1.Upgrade, + v8_2.Upgrade, } // Forks defines forks to be applied to the network diff --git a/app/upgrades/v8_2/constants.go b/app/upgrades/v8_2/constants.go new file mode 100644 index 000000000..9a3739067 --- /dev/null +++ b/app/upgrades/v8_2/constants.go @@ -0,0 +1,13 @@ +//nolint:revive +package v8_2 + +import ( + "github.com/classic-terra/core/v3/app/upgrades" +) + +const UpgradeName = "v8_2" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateV82UpgradeHandler, +} diff --git a/app/upgrades/v8_2/upgrades.go b/app/upgrades/v8_2/upgrades.go new file mode 100644 index 000000000..4182109c0 --- /dev/null +++ b/app/upgrades/v8_2/upgrades.go @@ -0,0 +1,21 @@ +//nolint:revive +package v8_2 + +import ( + "github.com/classic-terra/core/v3/app/keepers" + "github.com/classic-terra/core/v3/app/upgrades" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +func CreateV82UpgradeHandler( + mm *module.Manager, + cfg module.Configurator, + _ upgrades.BaseAppParamManager, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, cfg, fromVM) + } +} diff --git a/contrib/updates/prepare_cosmovisor.sh b/contrib/updates/prepare_cosmovisor.sh index 703be14a9..17d983443 100644 --- a/contrib/updates/prepare_cosmovisor.sh +++ b/contrib/updates/prepare_cosmovisor.sh @@ -5,7 +5,7 @@ # These fields should be fetched automatically in the future # Need to do more upgrade to see upgrade patterns -OLD_VERSION=v3.0.3 +OLD_VERSION=v3.1.3 # this command will retrieve the folder with the largest number in format v SOFTWARE_UPGRADE_NAME=$(ls -d -- ./app/upgrades/v* | sort -Vr | head -n 1 | xargs basename) BUILDDIR=$1