-
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(cheatcodes
): specify mis-matched fields on expectEmit
failure
#592
Comments
Closing this in favor of the more generic #928 |
@Evalir reopened this as I think it’s a good solution to keeping the current behavior, while also solving #5117 (comment), without having to implement broader improvements/refactors as mentioned in #928 |
expectEmit
failscheatcodes
): specify mis-matched fields on expectEmit
failure
@zerosnacks @klkvr I'm looking into implementing this (as a follow-up to or as a part of #8686) and am curious what the intended behavior would be for situations where multiple instances of the same event are emitted in a given tx, but none match. Should the params of the events that were emitted but don't quite match be highlighted red? I think highlighting params of events that match the expected topic 0 but fail another topic or data equivalence check is the way to go, just want to see if there are better alternatives. edit to add: we should constrain this to an expected address if applicable as well, of course |
Additionally, based on my understanding of the smart contract interfaces, we wouldn't be able to individually highlight data (unindexed) params, right? We'd have to parse and compare the abi-encoded bytestrings to determine which params don't match as well. |
Hi @topocount, great!
That would make sense to me, though limited to the mismatch to avoid warning / error fatigue
I believe that to be correct, worst case you could diff the bytestring and just display that |
Component
Forge
Describe the feature you would like
Using the
expectEmit
function from the vm cheats foundry provides for testing, failures don't provide much information about what was mismatched.Example:
It would be great to get more details about which fields were mismatched in this situation.
Additional context
No response
The text was updated successfully, but these errors were encountered: