Commit Graph

1 Commits

Author SHA1 Message Date
Felix Lange e92e22a7cf
ethclient: add RevertErrorData function and example (#30669)
Here I'm adding a new helper function that extracts the revert reason of
a contract call. Unfortunately, this aspect of the API is underspecified.
See these spec issues for more detail:

- https://github.com/ethereum/execution-apis/issues/232
- https://github.com/ethereum/execution-apis/issues/463
- https://github.com/ethereum/execution-apis/issues/523

The function added here only works with Geth-like servers that return
error code `3`. We will not be able to support all possible servers.
However, if there is a specific server implementation that makes it
possible to extract the same info, we could add it in the same function
as well.

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2024-11-07 20:26:02 +01:00