From aecdd74dc8c6967c4aceba0980adf1d1fb4a5107 Mon Sep 17 00:00:00 2001 From: Wany Date: Tue, 29 Mar 2022 15:44:48 +0800 Subject: [PATCH] fix GetTransactionReceiptsByBlock bug fix fields transactionHash --- internal/ethapi/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 0d3aeb35c6..f5d6016efe 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -670,6 +670,7 @@ func (s *PublicBlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, "contractAddress": nil, "logs": receipt.Logs, "logsBloom": receipt.Bloom, + "type": hexutil.Uint(tx.Type()), } // Assign receipt status or post state. @@ -681,7 +682,7 @@ func (s *PublicBlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, if receipt.Logs == nil { fields["logs"] = [][]*types.Log{} } - if borReceipt != nil { + if borReceipt != nil && idx == len(receipts)-1 { fields["transactionHash"] = txHash } // If the ContractAddress is 20 0x0 bytes, assume it is not a contract creation