From 435cf96abeeb1a6bd0207fb8af5ac8d0133f10b7 Mon Sep 17 00:00:00 2001 From: Till Ziegler Date: Wed, 24 Apr 2024 21:02:37 +0200 Subject: [PATCH] deps: add uprade name `v7_1` (#467) --- app/app.go | 3 ++- app/upgrades/v7_1/constants.go | 14 ++++++++++++++ app/upgrades/v7_1/upgrades.go | 20 ++++++++++++++++++++ contrib/updates/prepare_cosmovisor.sh | 2 +- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 app/upgrades/v7_1/constants.go create mode 100644 app/upgrades/v7_1/upgrades.go diff --git a/app/app.go b/app/app.go index f508e75fb..269ac5f94 100644 --- a/app/app.go +++ b/app/app.go @@ -50,6 +50,7 @@ import ( v6 "github.com/classic-terra/core/v2/app/upgrades/v6" v6_1 "github.com/classic-terra/core/v2/app/upgrades/v6_1" v7 "github.com/classic-terra/core/v2/app/upgrades/v7" + v7_1 "github.com/classic-terra/core/v2/app/upgrades/v7_1" customante "github.com/classic-terra/core/v2/custom/auth/ante" custompost "github.com/classic-terra/core/v2/custom/auth/post" @@ -68,7 +69,7 @@ var ( DefaultNodeHome string // Upgrades defines upgrades to be applied to the network - Upgrades = []upgrades.Upgrade{v2.Upgrade, v3.Upgrade, v4.Upgrade, v5.Upgrade, v6.Upgrade, v6_1.Upgrade, v7.Upgrade} + Upgrades = []upgrades.Upgrade{v2.Upgrade, v3.Upgrade, v4.Upgrade, v5.Upgrade, v6.Upgrade, v6_1.Upgrade, v7.Upgrade, v7_1.Upgrade} // Forks defines forks to be applied to the network Forks = []upgrades.Fork{} diff --git a/app/upgrades/v7_1/constants.go b/app/upgrades/v7_1/constants.go new file mode 100644 index 000000000..83e4fcbd2 --- /dev/null +++ b/app/upgrades/v7_1/constants.go @@ -0,0 +1,14 @@ +package v7_1 + +import ( + "github.com/classic-terra/core/v2/app/upgrades" + store "github.com/cosmos/cosmos-sdk/store/types" +) + +const UpgradeName = "v7_1" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateV7_1UpgradeHandler, + StoreUpgrades: store.StoreUpgrades{}, +} diff --git a/app/upgrades/v7_1/upgrades.go b/app/upgrades/v7_1/upgrades.go new file mode 100644 index 000000000..8ee61ac2a --- /dev/null +++ b/app/upgrades/v7_1/upgrades.go @@ -0,0 +1,20 @@ +package v7_1 + +import ( + "github.com/classic-terra/core/v2/app/keepers" + "github.com/classic-terra/core/v2/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 CreateV7_1UpgradeHandler( + mm *module.Manager, + cfg module.Configurator, + _ upgrades.BaseAppParamManager, + _ *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 08851968c..164bd53f6 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=v2.3.0 +OLD_VERSION=v2.4.2 # 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