Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (evm) [#789](https://github.com/crypto-org-chain/ethermint/pull/795) chore: add validation for HeaderHashNum and HistoryServeWindow in params
* (api) [#768](https://github.com/crypto-org-chain/ethermint/pull/768) feat: support create access list
* (rpc) [#804](https://github.com/crypto-org-chain/ethermint/pull/804) fix: add allow-unprotected-txs config
* (evm) [#809](https://github.com/crypto-org-chain/ethermint/pull/809) fix: relax preinstall rules

## [v0.22.0] - 2025-08-12

Expand Down
11 changes: 8 additions & 3 deletions x/evm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,16 @@
}

acct := k.accountKeeper.GetAccount(ctx, accAddress)
// check that the account is not already set
// check that code hash is empty
if acct != nil {
return errorsmod.Wrapf(types.ErrInvalidPreinstall,
"preinstall %s, address %s already has an account in account keeper", preinstall.Name, preinstall.Address)
if ethAcct, ok := acct.(ethermint.EthAccountI); ok {
if !types.IsEmptyCodeHash(ethAcct.GetCodeHash().Bytes()) {
return errorsmod.Wrapf(types.ErrInvalidPreinstall,
"preinstall %s, address %s already has a codehash", preinstall.Name, preinstall.Address)
}
}

Check failure on line 426 in x/evm/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

File is not properly formatted (gofumpt)
}

Check failure on line 427 in x/evm/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

unnecessary trailing newline (whitespace)
// create account with the account keeper and set code hash
acct = k.accountKeeper.NewAccountWithAddress(ctx, accAddress)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the logic, should only create new account when acct is nil, or use the acct fetched from keeper instead

if ethAcct, ok := acct.(ethermint.EthAccountI); ok {
Expand Down
Loading