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

Decouple JsonRpcError enum from the data field #5437

Closed
macfarla opened this issue May 5, 2023 · 5 comments · Fixed by #5629
Closed

Decouple JsonRpcError enum from the data field #5437

macfarla opened this issue May 5, 2023 · 5 comments · Fixed by #5629
Assignees
Labels
dev experience The build system, things that enable easier development etc. snack Smaller coding task - less than a day for an experienced dev TeamRevenant GH issues worked on by Revenant Team

Comments

@macfarla
Copy link
Contributor

macfarla commented May 5, 2023

JsonRpcError enum has code/message. It also has a data field which is used sometimes - currently for revert reason. But it's a bit of a hack because it gets reset as soon as that enum field gets used again (so, for example, you can't use this in unit tests to test actual vs expected values of the data field).

See #5421 for an example

See #5241 for an example

@macfarla macfarla added the dev experience The build system, things that enable easier development etc. label May 5, 2023
@siladu
Copy link
Contributor

siladu commented May 6, 2023

See #5421 for an example

Can you point to the specific example please @macfarla? All I see are cert updates.

@jframe
Copy link
Contributor

jframe commented May 8, 2023

The JsonRpcError.setData is used in a few RPCs. One example is the EthCall for the revert reason https://github.com/hyperledger/besu/blob/main/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthCall.java#L119

@macfarla
Copy link
Contributor Author

macfarla commented May 8, 2023

See #5421 for an example

Can you point to the specific example please @macfarla? All I see are cert updates.

Linked the wrong ticket - meant to be #5241

@macfarla macfarla added snack Smaller coding task - less than a day for an experienced dev TeamRevenant GH issues worked on by Revenant Team labels May 8, 2023
@macfarla
Copy link
Contributor Author

macfarla commented May 8, 2023

added snack/TeamRevenant label but any team could pick this up

@gtebrean
Copy link
Contributor

@macfarla please check if the open PR has the expected approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev experience The build system, things that enable easier development etc. snack Smaller coding task - less than a day for an experienced dev TeamRevenant GH issues worked on by Revenant Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants