From 2db736296c1089f3fbdf7328e7309e9fc7be1f13 Mon Sep 17 00:00:00 2001 From: Vladislav Mikitich Date: Sun, 26 Nov 2023 12:42:18 +0300 Subject: [PATCH] ibc upgrade migration --- app/app.go | 2 ++ app/export.go | 3 ++- app/upgrade/07tendermint13/handler.go | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/upgrade/07tendermint13/handler.go diff --git a/app/app.go b/app/app.go index 14ed1dff..e34d07f6 100644 --- a/app/app.go +++ b/app/app.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" + ibc07tendermint13 "github.com/Decentr-net/decentr/app/upgrade/07tendermint13" v160 "github.com/Decentr-net/decentr/app/upgrade/v160" v163 "github.com/Decentr-net/decentr/app/upgrade/v163" "github.com/cosmos/cosmos-sdk/baseapp" @@ -555,6 +556,7 @@ func New( app.UpgradeKeeper.SetUpgradeHandler(v160.Name, v160.Handler(app.configurator, app.mm)) app.UpgradeKeeper.SetUpgradeHandler(v163.Name, v160.Handler(app.configurator, app.mm)) + app.UpgradeKeeper.SetUpgradeHandler(ibc07tendermint13.Name, ibc07tendermint13.Handler(app.configurator, app.mm)) upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { diff --git a/app/export.go b/app/export.go index a744e549..41dcc83d 100644 --- a/app/export.go +++ b/app/export.go @@ -50,7 +50,8 @@ func (app *App) ExportAppStateAndValidators( // prepare for fresh start at zero height // NOTE zero height genesis is a temporary feature which will be deprecated -// in favour of export at a block height +// +// in favour of export at a block height func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { applyAllowedAddrs := false diff --git a/app/upgrade/07tendermint13/handler.go b/app/upgrade/07tendermint13/handler.go new file mode 100644 index 00000000..cbdca035 --- /dev/null +++ b/app/upgrade/07tendermint13/handler.go @@ -0,0 +1,18 @@ +package ibc07tendermint13 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +const Name = "07-tendermint-13" + +func Handler( + cfg module.Configurator, + mm *module.Manager, +) func(ctx sdk.Context, _ upgrade.Plan, _ module.VersionMap) (module.VersionMap, error) { + return func(ctx sdk.Context, _ upgrade.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, cfg, fromVM) + } +}