Skip to content

Commit

Permalink
Problem: no parsed log from old event (#482)
Browse files Browse the repository at this point in the history
* this change should have been included in 7a841e8
* skip txResponses length check
  • Loading branch information
mmsqe committed May 2, 2024
1 parent 62852ba commit 179e436
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (evm) [#466](https://github.com/crypto-org-chain/ethermint/pull/466) Fix evm response patching.
* (rpc) [#473](https://github.com/crypto-org-chain/ethermint/pull/473) Avoid panic on invalid elasticity_multiplier.
* (rpc) [#474](https://github.com/crypto-org-chain/ethermint/pull/474), [#476](https://github.com/crypto-org-chain/ethermint/pull/441) Align genesis related cmd.
* (rpc) [#480](https://github.com/crypto-org-chain/ethermint/pull/480) Fix parsed logs from old events.
* (rpc) [#480](https://github.com/crypto-org-chain/ethermint/pull/480), [#482](https://github.com/crypto-org-chain/ethermint/pull/482) Fix parsed logs from old events.

### Improvements

Expand Down
12 changes: 3 additions & 9 deletions x/evm/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,10 @@ func DecodeMsgLogsFromEvents(in []byte, events []abci.Event, msgIndex int, block
if err != nil {
return nil, err
}

if msgIndex >= len(txResponses) {
return nil, fmt.Errorf("invalid message index: %d", msgIndex)
}

logs, err := logsFromTxResponse(nil, txResponses[msgIndex], blockNumber), nil
if err != nil {
return nil, err
var logs []*ethtypes.Log
if msgIndex < len(txResponses) {
logs = logsFromTxResponse(nil, txResponses[msgIndex], blockNumber)
}

if len(logs) == 0 {
logs, err = TxLogsFromEvents(events, msgIndex)
}
Expand Down

0 comments on commit 179e436

Please sign in to comment.