From 479bd0f080b6b9e46876e0472c36d4b0164a6c39 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Thu, 2 Jun 2022 13:30:22 -0400 Subject: [PATCH] Add v10 upgrade boilerplate (#1649) ## What is the purpose of the change Unblock #1638 --- app/upgrades/v10/constants.go | 16 ++++++++++++++++ app/upgrades/v10/upgrades.go | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 app/upgrades/v10/constants.go create mode 100644 app/upgrades/v10/upgrades.go diff --git a/app/upgrades/v10/constants.go b/app/upgrades/v10/constants.go new file mode 100644 index 00000000000..dd85909c107 --- /dev/null +++ b/app/upgrades/v10/constants.go @@ -0,0 +1,16 @@ +package v9 + +import ( + "github.com/osmosis-labs/osmosis/v7/app/upgrades" + + store "github.com/cosmos/cosmos-sdk/store/types" +) + +// UpgradeName defines the on-chain upgrade name for the Osmosis v9 upgrade. +const UpgradeName = "v10" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{}, +} diff --git a/app/upgrades/v10/upgrades.go b/app/upgrades/v10/upgrades.go new file mode 100644 index 00000000000..e86d63f95b4 --- /dev/null +++ b/app/upgrades/v10/upgrades.go @@ -0,0 +1,20 @@ +package v9 + +import ( + 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/osmosis-labs/osmosis/v7/app/keepers" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // TODO: This upgrade is blocked on https://github.com/cosmos/cosmos-sdk/pull/11800 + return mm.RunMigrations(ctx, configurator, fromVM) + } +}