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

Commit

Permalink
review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Jan 15, 2022
1 parent 08e7238 commit 33eefab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rpc/ethereum/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ func FindTxAttributes(events []abci.Event, txHash string) (int, map[string]strin
// returns the msgIndex, returns -1 if not found.
func FindTxAttributesByIndex(events []abci.Event, txIndex uint64) int {
strIndex := []byte(strconv.FormatUint(txIndex, 10))
txIndexKey := []byte(evmtypes.AttributeKeyTxIndex)
msgIndex := -1
for _, event := range events {
if event.Type != evmtypes.EventTypeEthereumTx {
Expand All @@ -294,7 +295,7 @@ func FindTxAttributesByIndex(events []abci.Event, txIndex uint64) int {

msgIndex++

value := FindAttribute(event.Attributes, []byte(evmtypes.AttributeKeyTxIndex))
value := FindAttribute(event.Attributes, txIndexKey)
if !bytes.Equal(value, strIndex) {
continue
}
Expand Down

0 comments on commit 33eefab

Please sign in to comment.