Skip to content

Commit

Permalink
Merge pull request #34 from xrplevm/fix/enable-bank-precompile-in-v3
Browse files Browse the repository at this point in the history
[FIX] Enable bank precompile in v3
  • Loading branch information
AdriaCarrera authored Aug 27, 2024
2 parents bbc9c94 + 5675696 commit 674d285
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
goreleaser/goreleaser-cross:v1.23.0 release --clean --skip-validate
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (app *App) setupUpgradeHandlers() {
v3.CreateUpgradeHandler(
app.mm, app.configurator,
app.EvmKeeper,
app.Erc20Keeper,
app.AccountKeeper,
app.BankKeeper,
),
Expand Down
13 changes: 3 additions & 10 deletions app/upgrades/v3/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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 {
Expand All @@ -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)
Expand All @@ -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
}
Expand Down

0 comments on commit 674d285

Please sign in to comment.