From e144a89a026f05c60ba727fdb44838b6ac089022 Mon Sep 17 00:00:00 2001 From: Itzik Grossman Date: Sun, 13 Aug 2023 17:52:51 +0300 Subject: [PATCH] Added v1.10 empty upgrade handler --- app/app.go | 2 ++ app/upgrades/v1.10/upgrade.go | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 app/upgrades/v1.10/upgrade.go diff --git a/app/app.go b/app/app.go index db912e293..46c6b72c4 100644 --- a/app/app.go +++ b/app/app.go @@ -2,6 +2,7 @@ package app import ( "fmt" + v1_10 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.10" "io" "net/http" "os" @@ -100,6 +101,7 @@ var ( v1_7.Upgrade, v1_8.Upgrade, v1_9.Upgrade, + v1_10.Upgrade, } ) diff --git a/app/upgrades/v1.10/upgrade.go b/app/upgrades/v1.10/upgrade.go new file mode 100644 index 000000000..63021a68b --- /dev/null +++ b/app/upgrades/v1.10/upgrade.go @@ -0,0 +1,34 @@ +package v1_10 + +import ( + "fmt" + store "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/scrtlabs/SecretNetwork/app/keepers" + "github.com/scrtlabs/SecretNetwork/app/upgrades" +) + +const upgradeName = "v1.10" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: upgradeName, + CreateUpgradeHandler: createUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{}, +} + +func createUpgradeHandler(mm *module.Manager, keepers *keepers.SecretAppKeepers, configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info(` _ _ _____ _____ _____ _____ ______ `) + ctx.Logger().Info(`| | | | __ \ / ____| __ \ /\ | __ \| ____|`) + ctx.Logger().Info(`| | | | |__) | | __| |__) | / \ | | | | |__ `) + ctx.Logger().Info(`| | | | ___/| | |_ | _ / / /\ \ | | | | __| `) + ctx.Logger().Info(`| |__| | | | |__| | | \ \ / ____ \| |__| | |____ `) + ctx.Logger().Info(` \____/|_| \_____|_| \_\/_/ \_\_____/|______|`) + + ctx.Logger().Info(fmt.Sprintf("Running module migrations for %s...", upgradeName)) + return mm.RunMigrations(ctx, configurator, vm) + } +}