Skip to content

Commit

Permalink
Added enabled-precompiles param validation in InitGenesis
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed May 1, 2024
1 parent 105eb39 commit a16bc63
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions x/evm/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package evm
import (
"bytes"
"fmt"

Check failure on line 20 in x/evm/genesis.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

File is not `gofumpt`-ed (gofumpt)
precompile_modules "github.com/ethereum/go-ethereum/precompile/modules"

abci "github.com/cometbft/cometbft/abci/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -38,9 +39,15 @@ func InitGenesis(
) []abci.ValidatorUpdate {
k.WithChainID(ctx)

data.Params.GetEnabledPrecompiles()
err := types.CheckIfEnabledPrecompilesAreRegistered(
precompile_modules.RegisteredModules(),
data.Params.GetEnabledPrecompiles(),
)
if err != nil {
panic(err)
}

err := k.SetParams(ctx, data.Params)
err = k.SetParams(ctx, data.Params)
if err != nil {
panic(fmt.Errorf("error setting params %s", err))
}
Expand Down

0 comments on commit a16bc63

Please sign in to comment.