Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(strv2): upgrade handler v19 #2514

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ import (
"github.com/evmos/evmos/v18/app/post"
v17 "github.com/evmos/evmos/v18/app/upgrades/v17"
v18 "github.com/evmos/evmos/v18/app/upgrades/v18"
v19 "github.com/evmos/evmos/v18/app/upgrades/v19"
"github.com/evmos/evmos/v18/encoding"
"github.com/evmos/evmos/v18/ethereum/eip712"
"github.com/evmos/evmos/v18/precompiles/common"
Expand Down Expand Up @@ -1136,6 +1137,14 @@ func (app *Evmos) setupUpgradeHandlers() {
),
)

// v19 upgrade handler
app.UpgradeKeeper.SetUpgradeHandler(
v19.UpgradeName,
v19.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 Down
11 changes: 11 additions & 0 deletions app/upgrades/v19/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 v19

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

package v19

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 v18
func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
// Leave modules as-is to avoid running InitGenesis.
return mm.RunMigrations(ctx, configurator, vm)
}
}
1 change: 0 additions & 1 deletion x/erc20/keeper/evm_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ func (k Keeper) PostProcessTransferEvent(

// Check that the contract is a registered token pair
contractAddr := log.Address

isWevmos := getIsWevmos(ctx, contractAddr)
var pair types.TokenPair
var found bool
Expand Down