Repository navigation
fix: match non-indexed string and bytes filters in parseEventLogs - #5257
mortezashojaei wants to merge 5 commits into
Conversation
The args filter has hashed every string and bytes value since it was added, which only matches indexed parameters.
🦋 Changeset detectedLatest commit: bf15025 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks! The fix looks right. I confirmed the new non-indexed tests fail on
Generated by Claude Code |
These calls fail typecheck, and the parseEventLogs assertions already cover the behavior.
Decoded bytes are lowercase, so a mixed-case filter never compared equal.
Cover mixed-case bytes filters with the inline snapshots used for stable results.
The inline pattern duplicated the existing bytes type check.
Thanks for the review.
Also covered |
parseEventLogshas hashed everystringandbytesfilter sinceargswas added in #2533. That followed the topic rule: an indexed dynamic value is stored askeccak256of its contents. A non-indexed value is ABI-decoded back to the original string or hex, so the filter compared the hash with"hello"or0x1234and dropped the log.#5238 fixed the indexed case where a hex-looking string was hashed as raw bytes instead of UTF-8. Hashing stayed unconditional, so non-indexed arguments still never matched.
getLogsandgetContractEventspassargsthrough this helper and dropped the same logs.The hash now runs only when the parameter is indexed.
Test plan
string"hello"matches;"goodbye"does notbytes0x1234matches;0x5678does notbytesstill matches by topic hash