Merge pull request #1085 from bbaktaeho/fix/eth_api

internal/ethapi: fix GetTransactionReceiptsByBlock method
This commit is contained in:
Arpit Temani 2023-12-12 10:57:53 +05:30 committed by GitHub
commit 2be2789ebb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -723,6 +723,11 @@ func (s *BlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, block
"logs": receipt.Logs, "logs": receipt.Logs,
"logsBloom": receipt.Bloom, "logsBloom": receipt.Bloom,
"type": hexutil.Uint(tx.Type()), "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. // Assign receipt status or post state.
@ -733,7 +738,7 @@ func (s *BlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, block
} }
if receipt.Logs == nil { if receipt.Logs == nil {
fields["logs"] = [][]*types.Log{} fields["logs"] = []*types.Log{}
} }
if borReceipt != nil && idx == len(receipts)-1 { if borReceipt != nil && idx == len(receipts)-1 {