Open EzraWeller opened 2 years ago
Closing this in favor of the more generic https://github.com/foundry-rs/foundry/issues/928
@Evalir reopened this as I think it’s a good solution to keeping the current behavior, while also solving https://github.com/foundry-rs/foundry/issues/5117#issuecomment-1599680238, without having to implement broader improvements/refactors as mentioned in #928
@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!
Should the params of the events that were emitted but don't quite match be highlighted red?
That would make sense to me, though limited to the mismatch to avoid warning / error fatigue
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.
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