fix GetTransactionReceiptsByBlock

This commit is contained in:
bbaktaeho 2023-11-16 23:04:53 +09:00
parent d345879437
commit 7714cd88c1

View file

@ -723,8 +723,13 @@ 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.
if len(receipt.PostState) > 0 { if len(receipt.PostState) > 0 {
fields["root"] = hexutil.Bytes(receipt.PostState) fields["root"] = hexutil.Bytes(receipt.PostState)
@ -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 {