fix: fixes debug_traceBlockByNumber response to not be null for a transaction with no internal calls #4440
+51
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When calling debug_traceBlockByNumber for a block, and some transaction from the block hasn't made any calls, then null would be returned for that transaction. The result should be the root call object with an empty calls array instead of null. We build the root object from the same fields in the transaction object that would back the root call:
from
,to
,value
,gas
,gasUsed
,input
,output
/error
(fromtransactionsResponse
) andcalls: []
.actionsResponse[0].call_type
fortype
. When actions are absent, we infertype
as"CALL"
ifto
exists, otherwise"CREATE"
. Everything else matches the root call data.Related issue(s)
Fixes #4386
Testing Guide
debug_traceBlockByNumber
for a block that contains a transaction with no callsChanges from original design (optional)
N/A
Additional work needed (optional)
N/A
Checklist