-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(tracing
): log failed expectEmit
events as error traces
#8506
Comments
expectRevert
events as error tracesexpectEmit
events as error traces
Hi @topocount thanks for your suggestion, any stylistic changes to traces are to be applied in https://github.com/paradigmxyz/revm-inspectors/blob/main/src/tracing/writer.rs and changes to indicating whether something is an error is to be done in Foundry (it may be the case that it requires that). |
expectEmit
events as error tracestracing
): log failed expectEmit
events as error traces
Assigned this to you @topocount, please let me know if you need any pointers or have any questions along the way |
Hey @zerosnacks I think I have a bead on an implementation path. Thanks for your guidance
don't you mean "borrows?" 😎 |
@zerosnacks is it okay if I create a new error in the cheatcodes package that that holds the abi-encoded bytestring of the unmatched event? I'd also like to capture the index of the event in the error UnmatchedEvent(uint256 positionExpected, bytes rawLog); |
I'm not sure if I understand it completely but it makes sense to me to pass the reverted error in a structured manner. Perhaps using an error with two structs holding an |
Component
Forge
Describe the feature you would like
Currently, the tracer and error logger aren't very helpful when a matching event is not caught. I'd like to attempt to highlight the mismatched event(s) in red instead of white (or neutral) as they they are currently displayed by the tracer.
I'd like to contribute this small feature myself.
Additional context
This seems like a superficial improvement, but digging through large stack traces of emitted logs, trying to manually pick out the one that failed can be quite time consuming during development and integration testing.
The text was updated successfully, but these errors were encountered: