Skip to content

Commit

Permalink
auto: code-gen upgrade handler v21 (osmosis-labs#6776)
Browse files Browse the repository at this point in the history
* [create-pull-request] automated change

* Update config.go

---------

Co-authored-by: czarcas7ic <[email protected]>
Co-authored-by: Adam Tucker <[email protected]>
  • Loading branch information
3 people authored Oct 27, 2023
1 parent 0d36c62 commit 3abc40e
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
BUILDDIR ?= $(CURDIR)/build
DOCKER := $(shell which docker)
E2E_UPGRADE_VERSION := "v20"
E2E_UPGRADE_VERSION := "v21"
#SHELL := /bin/bash

# Go version to be used in docker images
Expand Down
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import (
v18 "github.com/osmosis-labs/osmosis/v20/app/upgrades/v18"
v19 "github.com/osmosis-labs/osmosis/v20/app/upgrades/v19"
v20 "github.com/osmosis-labs/osmosis/v20/app/upgrades/v20"
v21 "github.com/osmosis-labs/osmosis/v20/app/upgrades/v21"
v3 "github.com/osmosis-labs/osmosis/v20/app/upgrades/v3"
v4 "github.com/osmosis-labs/osmosis/v20/app/upgrades/v4"
v5 "github.com/osmosis-labs/osmosis/v20/app/upgrades/v5"
Expand Down Expand Up @@ -106,7 +107,7 @@ var (

// _ sdksimapp.App = (*OsmosisApp)(nil)

Upgrades = []upgrades.Upgrade{v4.Upgrade, v5.Upgrade, v7.Upgrade, v9.Upgrade, v11.Upgrade, v12.Upgrade, v13.Upgrade, v14.Upgrade, v15.Upgrade, v16.Upgrade, v17.Upgrade, v18.Upgrade, v19.Upgrade, v20.Upgrade}
Upgrades = []upgrades.Upgrade{v4.Upgrade, v5.Upgrade, v7.Upgrade, v9.Upgrade, v11.Upgrade, v12.Upgrade, v13.Upgrade, v14.Upgrade, v15.Upgrade, v16.Upgrade, v17.Upgrade, v18.Upgrade, v19.Upgrade, v20.Upgrade, v21.Upgrade}
Forks = []upgrades.Fork{v3.Fork, v6.Fork, v8.Fork, v10.Fork}
)

Expand Down
19 changes: 19 additions & 0 deletions app/upgrades/v21/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package v21

import (
"github.com/osmosis-labs/osmosis/v20/app/upgrades"

store "github.com/cosmos/cosmos-sdk/store/types"
)

// UpgradeName defines the on-chain upgrade name for the Osmosis v21 upgrade.
const UpgradeName = "v21"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{},
Deleted: []string{},
},
}
28 changes: 28 additions & 0 deletions app/upgrades/v21/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package v21

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/v20/app/keepers"
"github.com/osmosis-labs/osmosis/v20/app/upgrades"
)

func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
bpm upgrades.BaseAppParamManager,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// Run migrations before applying any other state changes.
// NOTE: DO NOT PUT ANY STATE CHANGES BEFORE RunMigrations().
migrations, err := mm.RunMigrations(ctx, configurator, fromVM)
if err != nil {
return nil, err
}

return migrations, nil
}
}
4 changes: 2 additions & 2 deletions tests/e2e/containers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const (
// It should be uploaded to Docker Hub. OSMOSIS_E2E_SKIP_UPGRADE should be unset
// for this functionality to be used.
previousVersionOsmoRepository = "osmolabs/osmosis"
previousVersionOsmoTag = "19.0.0-alpine"
previousVersionOsmoTag = "20.1.0-alpine"
// Pre-upgrade repo/tag for osmosis initialization (this should be one version below upgradeVersion)
previousVersionInitRepository = "osmolabs/osmosis-e2e-init-chain"
previousVersionInitTag = "19.0.0"
previousVersionInitTag = "20.1.0"
// Hermes repo/version for relayer
relayerRepository = "informalsystems/hermes"
relayerTag = "1.5.1"
Expand Down

0 comments on commit 3abc40e

Please sign in to comment.