Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/ethapi: fix GetTransactionReceiptsByBlock method #1085

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,11 @@
"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)

Check warning on line 730 in internal/ethapi/api.go

View check run for this annotation

Codecov / codecov/patch

internal/ethapi/api.go#L726-L730

Added lines #L726 - L730 were not covered by tests
}

// Assign receipt status or post state.
Expand All @@ -733,7 +738,7 @@
}

if receipt.Logs == nil {
fields["logs"] = [][]*types.Log{}
fields["logs"] = []*types.Log{}

Check warning on line 741 in internal/ethapi/api.go

View check run for this annotation

Codecov / codecov/patch

internal/ethapi/api.go#L741

Added line #L741 was not covered by tests
}

if borReceipt != nil && idx == len(receipts)-1 {
Expand Down
Loading