Skip to content

Commit

Permalink
Add v10 upgrade boilerplate (#1649)
Browse files Browse the repository at this point in the history
## What is the purpose of the change

Unblock #1638
  • Loading branch information
ValarDragon authored Jun 2, 2022
1 parent d5cd033 commit 479bd0f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/upgrades/v10/constants.go
Original file line number Diff line number Diff line change
@@ -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{},
}
20 changes: 20 additions & 0 deletions app/upgrades/v10/upgrades.go
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit 479bd0f

Please sign in to comment.