diff --git a/app/app.go b/app/app.go index 4e4384a3..fa7bf7a2 100644 --- a/app/app.go +++ b/app/app.go @@ -61,6 +61,7 @@ import ( v2_0_0 "github.com/onomyprotocol/onomy/app/upgrades/v2.0.0" v2_1_0 "github.com/onomyprotocol/onomy/app/upgrades/v2.1.0" v2_1_1 "github.com/onomyprotocol/onomy/app/upgrades/v2.1.1" + v2_1_2 "github.com/onomyprotocol/onomy/app/upgrades/v2.1.2" "github.com/onomyprotocol/onomy/docs" ) @@ -464,6 +465,7 @@ func (app *OnomyApp) setupUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler(v2_0_0.Name, v2_0_0.CreateUpgradeHandler(app.mm, app.configurator, &app.AppKeepers)) app.UpgradeKeeper.SetUpgradeHandler(v2_1_0.Name, v2_1_0.CreateUpgradeHandler(app.mm, app.configurator, &app.AppKeepers)) app.UpgradeKeeper.SetUpgradeHandler(v2_1_1.Name, v2_1_1.CreateUpgradeHandler(app.mm, app.configurator, &app.AppKeepers)) + app.UpgradeKeeper.SetUpgradeHandler(v2_1_2.Name, v2_1_2.CreateUpgradeHandler(app.mm, app.configurator, &app.AppKeepers)) upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { diff --git a/app/upgrades/v2.1.2/upgrade.go b/app/upgrades/v2.1.2/upgrade.go new file mode 100644 index 00000000..9cb5ac51 --- /dev/null +++ b/app/upgrades/v2.1.2/upgrade.go @@ -0,0 +1,32 @@ +// Package v1_1_4 is contains chain upgrade of the corresponding version. +package v2_1_1 //nolint:revive,stylecheck // app version + +import ( + "context" + upgradetypes "cosmossdk.io/x/upgrade/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + "github.com/onomyprotocol/onomy/app/keepers" +) + +// Name is migration name. +const Name = "v2.1.2" + +// UpgradeHandler is an x/upgrade handler. +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + + return func(c context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx := sdk.UnwrapSDKContext(c) + vm, err := mm.RunMigrations(ctx, configurator, vm) + if err != nil { + return vm, err + } + + return vm, nil + } +}