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

Include human-friendly error messages on EVM transaction events #6836

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-Peter
Copy link
Collaborator

@m-Peter m-Peter commented Dec 24, 2024

Closes #6770

@codecov-commenter
Copy link

codecov-commenter commented Dec 24, 2024

Codecov Report

Attention: Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.

Project coverage is 41.12%. Comparing base (219660a) to head (7fb6ff4).

Files with missing lines Patch % Lines
fvm/evm/events/events.go 28.57% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6836      +/-   ##
==========================================
- Coverage   41.12%   41.12%   -0.01%     
==========================================
  Files        2107     2107              
  Lines      185330   185336       +6     
==========================================
+ Hits        76220    76222       +2     
- Misses     102710   102714       +4     
  Partials     6400     6400              
Flag Coverage Δ
unittests 41.12% <28.57%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m-Peter m-Peter force-pushed the mpeter/evm-events-abi-decode-assert-errors branch from 967e69d to 2d8eb89 Compare December 27, 2024 15:13
@m-Peter m-Peter force-pushed the mpeter/evm-events-abi-decode-assert-errors branch from 2d8eb89 to 7fb6ff4 Compare December 29, 2024 11:46
Comment on lines +67 to +73
errorMessage := p.Result.ErrorMsg()
if p.Result.ResultSummary().ErrorCode == types.ExecutionErrCodeExecutionReverted {
reason, errUnpack := abi.UnpackRevert(p.Result.ReturnedData)
if errUnpack == nil {
errorMessage = fmt.Sprintf("%v: %v", gethVM.ErrExecutionReverted.Error(), reason)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make this a method on types.Result. Maybe call it ErrorMessageWithRevertReason or something.

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.

[Flow EVM] Consider including RevertReason string in EVM.TransactionExecuted event payload
3 participants