Skip to content

Commit

Permalink
fix empty topics in a non-breaking way (#35)
Browse files Browse the repository at this point in the history
related: evmos#840
  • Loading branch information
yihuang committed Dec 14, 2021
1 parent 8280550 commit 6defb50
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rpc/ethereum/backend/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,11 @@ func TxLogsFromEvents(events []abci.Event) ([]*ethtypes.Log, error) {
logs = append(logs, &log)
}
}
return evmtypes.LogsToEthereum(logs), nil
ethLogs := evmtypes.LogsToEthereum(logs)
for i := range ethLogs {
if ethLogs[i].Topics == nil {
ethLogs[i].Topics = make([]common.Hash, 0)
}
}
return ethLogs, nil
}

0 comments on commit 6defb50

Please sign in to comment.