Skip to content

Commit

Permalink
Merge branch 'main' into GAtom22/revert-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
GAtom22 committed Jan 25, 2024
2 parents 9bb8bb3 + 51cc816 commit ae13493
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ import (
ethante "github.com/evmos/evmos/v16/app/ante/evm"
"github.com/evmos/evmos/v16/app/post"
v16 "github.com/evmos/evmos/v16/app/upgrades/v16"
v17 "github.com/evmos/evmos/v16/app/upgrades/v17"
"github.com/evmos/evmos/v16/encoding"
"github.com/evmos/evmos/v16/ethereum/eip712"
"github.com/evmos/evmos/v16/precompiles/common"
Expand Down Expand Up @@ -1142,6 +1143,14 @@ func (app *Evmos) setupUpgradeHandlers() {
),
)

// v17 upgrade handler
app.UpgradeKeeper.SetUpgradeHandler(
v17.UpgradeName,
v17.CreateUpgradeHandler(
app.mm, app.configurator,
),
)

// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
// This will read that value, and execute the preparations for the upgrade.
Expand All @@ -1162,6 +1171,8 @@ func (app *Evmos) setupUpgradeHandlers() {
storeUpgrades = &storetypes.StoreUpgrades{
Deleted: []string{"recoveryv1", "incentives", "claims"},
}
case v17.UpgradeName:
// no store upgrades
default:
// no-op
}
Expand Down
11 changes: 11 additions & 0 deletions app/upgrades/v17/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright Tharsis Labs Ltd.(Evmos)
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

package v17

const (
// UpgradeName is the shared upgrade plan name for mainnet
UpgradeName = "v17.0.0"
// UpgradeInfo defines the binaries that will be used for the upgrade
UpgradeInfo = `'{"binaries":{"darwin/amd64":"https://github.com/evmos/evmos/releases/download/v17.0.0/evmos_17.0.0_Darwin_arm64.tar.gz","darwin/x86_64":"https://github.com/evmos/evmos/releases/download/v17.0.0/evmos_17.0.0_Darwin_x86_64.tar.gz","linux/arm64":"https://github.com/evmos/evmos/releases/download/v17.0.0/evmos_17.0.0_Linux_arm64.tar.gz","linux/amd64":"https://github.com/evmos/evmos/releases/download/v17.0.0/evmos_17.0.0_Linux_amd64.tar.gz","windows/x86_64":"https://github.com/evmos/evmos/releases/download/v17.0.0/evmos_17.0.0_Windows_x86_64.zip"}}'`
)
24 changes: 24 additions & 0 deletions app/upgrades/v17/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright Tharsis Labs Ltd.(Evmos)
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

package v17

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

// CreateUpgradeHandler creates an SDK upgrade handler for v17.0.0
func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
logger := ctx.Logger().With("upgrade", UpgradeName)

// Leave modules are as-is to avoid running InitGenesis.
logger.Debug("running module migrations ...")
return mm.RunMigrations(ctx, configurator, vm)
}
}

0 comments on commit ae13493

Please sign in to comment.