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

RPC: add data field to RpcError / eth_call error #3547

Merged
merged 5 commits into from
Jul 26, 2024
Merged

Conversation

ScottyPoi
Copy link
Contributor

@ScottyPoi ScottyPoi commented Jul 26, 2024

Updates to satisfy hive rpc-spec tests.

Adds an optional data field to the type RpcError:

RpcError = {
  code: number
  message: string
  trace?: string
  data?: string
}

eth_call

per hive tests: eth_call/call-revert-abi-error and eth_call/call-revert-abi-panic

when eth_call reverts, it should return an error object:

{ code: 3,
data: <executionResult>,
message: <error message> }

This change to eth_call fixes these 2 failing hive tests:

 if (execResult.exceptionError !== undefined) {
      throw {
        code: 3,
        data: bytesToHex(execResult.returnValue),
        message: execResult.exceptionError.error,
      }
    }

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (fb50628) to head (901dae4).
Report is 12 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (fb50628) and HEAD (901dae4). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (fb50628) HEAD (901dae4)
tx 1 0
Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
client 0.00% <0.00%> (ø)
tx ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM 🙏🙂

@holgerd77 holgerd77 merged commit bcb0a84 into master Jul 26, 2024
34 of 36 checks passed
@holgerd77 holgerd77 deleted the RPC-error-data branch July 26, 2024 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants