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

Fix trace_block for stateDiffTracer #417

Merged
merged 1 commit into from
Sep 27, 2021
Merged

Conversation

ziogaschr
Copy link
Member

Fix trace_block when used with the stateDiffTracer, as the trace_block was expecting an array while stateDiff returns a JS object.

This has been tested on classic.

Before fix:

> trace.block('0x4BAF8', {"tracer":"stateDiffTracer"})
Error: method handler crashed
        at web3.js:6347:37(47)
        at web3.js:5081:62(37)
        at <eval>:1:12(7)

After fix:

> trace.block('0x4BAF8', {"tracer":"stateDiffTracer"})
[{}, {
    action: {
      author: "0x7e6930b63d03e88f5928c5cd6ee3fcee4d714f7f",
      rewardType: "block",
      value: "0x4563918244f40000"
    },
    blockHash: "0x8cd39d130fd3eb24296c571a5d4bf29f47b236538e297e1b009fae8ad0b9ffbe",
    blockNumber: 310008,
    result: null,
    subtraces: 0,
    traceAddress: [],
    transactionHash: null,
    transactionPosition: null,
    type: "reward"
}]

@ziogaschr ziogaschr requested a review from meowsbits September 23, 2021 18:32
@ziogaschr ziogaschr merged commit 408c881 into master Sep 27, 2021
@ziogaschr ziogaschr deleted the fix/trace-block-state-diff branch September 27, 2021 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants