From 567569634526e3504c2d7cba1e7aac1b6d927b15 Mon Sep 17 00:00:00 2001 From: AdriaCarrera Date: Tue, 27 Aug 2024 15:06:50 +0200 Subject: [PATCH] fix: enable bank precompile in v3 chore: bump goreleaser to v1.23.0 --- .github/workflows/goreleaser.yml | 2 +- .github/workflows/release.yml | 2 +- app/upgrades.go | 1 - app/upgrades/v3/upgrades.go | 13 +++---------- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index ab80dfc..51b6720 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -22,4 +22,4 @@ jobs: run: | docker run --rm -e CGO_ENABLED -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/go/src/exrp -w /go/src/exrp \ - goreleaser/goreleaser-cross:v1.20.2 release --clean --skip-validate \ No newline at end of file + goreleaser/goreleaser-cross:v1.23.0 release --clean --skip-validate \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 224f8e0..21ac32c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,4 +55,4 @@ jobs: run: | docker run --rm -e CGO_ENABLED -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/go/src/exrp -w /go/src/exrp \ - goreleaser/goreleaser-cross:v1.20.2 release --clean --skip-validate + goreleaser/goreleaser-cross:v1.23.0 release --clean --skip-validate diff --git a/app/upgrades.go b/app/upgrades.go index 26bfe54..3cec45f 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -34,7 +34,6 @@ func (app *App) setupUpgradeHandlers() { v3.CreateUpgradeHandler( app.mm, app.configurator, app.EvmKeeper, - app.Erc20Keeper, app.AccountKeeper, app.BankKeeper, ), diff --git a/app/upgrades/v3/upgrades.go b/app/upgrades/v3/upgrades.go index 9210543..54e0e20 100644 --- a/app/upgrades/v3/upgrades.go +++ b/app/upgrades/v3/upgrades.go @@ -8,10 +8,9 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" v16 "github.com/evmos/evmos/v19/app/upgrades/v16" - v192 "github.com/evmos/evmos/v19/app/upgrades/v19_2" + bankprecompile "github.com/evmos/evmos/v19/precompiles/bank" "github.com/evmos/evmos/v19/precompiles/bech32" "github.com/evmos/evmos/v19/precompiles/p256" - erc20keeper "github.com/evmos/evmos/v19/x/erc20/keeper" evmkeeper "github.com/evmos/evmos/v19/x/evm/keeper" ) @@ -20,7 +19,6 @@ func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, ek *evmkeeper.Keeper, - erc20Keeper erc20keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) upgradetypes.UpgradeHandler { @@ -33,12 +31,6 @@ func CreateUpgradeHandler( return nil, err } - /** Evmos v19 upgrades (pre-module upgrades) **/ - // Add code extensions - if err := v192.AddCodeToERC20Extensions(ctx, logger, erc20Keeper); err != nil { - return nil, err - } - /** Module upgrades **/ logger.Debug("running module migrations ...") versionMap, err := mm.RunMigrations(ctx, configurator, vm) @@ -51,7 +43,8 @@ func CreateUpgradeHandler( // enable secp256r1 and bech32 precompiles p256Address := p256.Precompile{}.Address() bech32Address := bech32.Precompile{}.Address() - if err := ek.EnableStaticPrecompiles(ctx, p256Address, bech32Address); err != nil { + bankAddress := bankprecompile.Precompile{}.Address() + if err := ek.EnableStaticPrecompiles(ctx, p256Address, bech32Address, bankAddress); err != nil { logger.Error("failed to enable precompiles", "error", err.Error()) return nil, err }