Skip to content

ethclient: add test coverage for RevertErrorData with EstimateGas#35197

Open
ShauryaaSharma wants to merge 1 commit into
ethereum:masterfrom
ShauryaaSharma:ethclient/revert-error-data-tests
Open

ethclient: add test coverage for RevertErrorData with EstimateGas#35197
ShauryaaSharma wants to merge 1 commit into
ethereum:masterfrom
ShauryaaSharma:ethclient/revert-error-data-tests

Conversation

@ShauryaaSharma

Copy link
Copy Markdown

RevertErrorData was added in #30669 to let callers extract EVM revert bytes from errors returned by contract calls. Its doc comment states the function works for both CallContract and EstimateGas, but only a CallContract example existed; the EstimateGas path had no test or documentation, leaving it unverified.

This change adds ExampleRevertErrorData_estimateGas to document the EstimateGas usage and TestRevertErrorData to assert that both methods return identical revert bytes for a reverting contract, and that plain non-revert errors are correctly rejected by the function.

Fixes #27539.

RevertErrorData was added in ethereum#30669 with a doc comment stating it works
for both CallContract and EstimateGas, but only a CallContract example
existed. Add ExampleRevertErrorData_estimateGas to document the
EstimateGas path and TestRevertErrorData to verify both paths return
identical revert bytes and that non-revert errors are correctly rejected.
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.

ethapi,backends: Export revertError for EstimateGas failures

1 participant