From 7714cd88c15b13a8900b457100cdf908a2c2e4ee Mon Sep 17 00:00:00 2001 From: bbaktaeho Date: Thu, 16 Nov 2023 23:04:53 +0900 Subject: [PATCH 1/2] fix GetTransactionReceiptsByBlock --- internal/ethapi/api.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 83b8f22edf..ac8a273b2a 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -723,8 +723,13 @@ func (s *BlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, block "logs": receipt.Logs, "logsBloom": receipt.Bloom, "type": hexutil.Uint(tx.Type()), + "effectiveGasPrice": (*hexutil.Big)(receipt.EffectiveGasPrice), } + if receipt.EffectiveGasPrice == nil { + fields["effectiveGasPrice"] = new(hexutil.Big) + } + // Assign receipt status or post state. if len(receipt.PostState) > 0 { fields["root"] = hexutil.Bytes(receipt.PostState) @@ -733,7 +738,7 @@ func (s *BlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, block } if receipt.Logs == nil { - fields["logs"] = [][]*types.Log{} + fields["logs"] = []*types.Log{} } if borReceipt != nil && idx == len(receipts)-1 { From 18c880280bf04f99418841f502722f6a8f17c506 Mon Sep 17 00:00:00 2001 From: bbaktaeho Date: Fri, 17 Nov 2023 19:34:50 +0900 Subject: [PATCH 2/2] fix: lint --- internal/ethapi/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index ac8a273b2a..77e9bb6dd3 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -727,8 +727,8 @@ func (s *BlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, block } if receipt.EffectiveGasPrice == nil { - fields["effectiveGasPrice"] = new(hexutil.Big) - } + fields["effectiveGasPrice"] = new(hexutil.Big) + } // Assign receipt status or post state. if len(receipt.PostState) > 0 {