Skip to content

Commit

Permalink
chore: use static relese vesrion for upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Aug 6, 2024
1 parent 6cd92f3 commit 037699e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/setup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import (
"github.com/cosmos/cosmos-sdk/x/upgrade/types"
"golang.org/x/exp/slices"

"github.com/zeta-chain/zetacore/pkg/constant"
authoritytypes "github.com/zeta-chain/zetacore/x/authority/types"
emissionstypes "github.com/zeta-chain/zetacore/x/emissions/types"
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
)

const releaseVersion = "v19"

func SetupHandlers(app *App) {
// Set param key table for params module migration
for _, subspace := range app.ParamsKeeper.GetSubspaces() {
Expand Down Expand Up @@ -135,9 +136,9 @@ func SetupHandlers(app *App) {
}

app.UpgradeKeeper.SetUpgradeHandler(
constant.Version,
releaseVersion,

Check warning on line 139 in app/setup_handlers.go

View check run for this annotation

Codecov / codecov/patch

app/setup_handlers.go#L139

Added line #L139 was not covered by tests
func(ctx sdk.Context, _ types.Plan, vm module.VersionMap) (module.VersionMap, error) {
app.Logger().Info("Running upgrade handler for " + constant.Version)
app.Logger().Info("Running upgrade handler for " + releaseVersion)

Check warning on line 141 in app/setup_handlers.go

View check run for this annotation

Codecov / codecov/patch

app/setup_handlers.go#L141

Added line #L141 was not covered by tests

var err error
for _, upgradeHandler := range upgradeHandlerFns {
Expand All @@ -155,7 +156,7 @@ func SetupHandlers(app *App) {
if err != nil {
panic(err)
}
if upgradeInfo.Name == constant.Version && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
if upgradeInfo.Name == releaseVersion && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {

Check warning on line 159 in app/setup_handlers.go

View check run for this annotation

Codecov / codecov/patch

app/setup_handlers.go#L159

Added line #L159 was not covered by tests
// Use upgrade store loader for the initial loading of all stores when app starts,
// it checks if version == upgradeHeight and applies store upgrades before loading the stores,
// so that new stores start with the correct version (the current height of chain),
Expand Down

0 comments on commit 037699e

Please sign in to comment.