Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

filter non eth txs in block rpc response #741

Merged
merged 17 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -59,6 +59,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (evm, test) [tharsis#649](https://github.com/tharsis/ethermint/pull/649) Test DynamicFeeTx.
* (evm) [tharsis#702](https://github.com/tharsis/ethermint/pull/702) Fix panic in web3 RPC handlers
* (rpc) [tharsis#720](https://github.com/tharsis/ethermint/pull/720) Fix `debug_traceTransaction` failure
* (rpc) [tharsis#741](https://github.com/tharsis/ethermint/pull/741) Fix `eth_getBlockByNumberAndHash` return with non eth txs

### Improvements

Expand Down
7 changes: 7 additions & 0 deletions rpc/ethereum/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ func (e *EVMBackend) EthBlockFromTendermint(

tx := ethMsg.AsTransaction()

// check tx exists on EVM
_, err := e.GetTxByEthHash(tx.Hash())
if err != nil {
e.logger.Debug("failed to query eth tx hash", "hash", tx.Hash().Hex(), "error", err.Error())
continue
}

if !fullTx {
hash := tx.Hash()
ethRPCTxs = append(ethRPCTxs, hash)
Expand Down