From 33eefab945821439bd7e00f36a7282dd93439d1f Mon Sep 17 00:00:00 2001 From: HuangYi Date: Sat, 15 Jan 2022 20:20:54 +0800 Subject: [PATCH] review suggestion --- rpc/ethereum/types/utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpc/ethereum/types/utils.go b/rpc/ethereum/types/utils.go index fd6fad93f1..31abc28645 100644 --- a/rpc/ethereum/types/utils.go +++ b/rpc/ethereum/types/utils.go @@ -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 { @@ -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 }