fix: scope --token-address filter to actual token addresses#298
Conversation
buildCommonTokenTransferData unconditionally set data.subjects = subjects ?? [], causing the update path (applyDefaults: false) to overwrite existing subjects with an empty array via shallow merge. Now subjects is only set when the user explicitly passes --subject, matching the pattern used by counterparties. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ounts Add tests verifying --token-address only matches actual token addresses in inclusion/exclusion arrays, not chain names or other data fields. Fix test counts for the 5th alert fixture added in prior commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pr-reviewer Summary📝 1 finding Review completed. Please address the findings below. Findings by Severity
Review effort: 2/5 (Simple) SummaryThis is a clean, focused PR that correctly addresses two issues: a tighter token-address filter and a Findings (1 low)
|
…ilter - Fix broken create integration tests by supplying required fields - Add 10 dedicated validateAlertData unit tests (pass + throw per type) - Tighten --token-address filter to exact match instead of substring - Simplify isRangeSet with loose equality Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
--token-addressfilter usedJSON.stringify(a.data).includes(addr), a raw substring search across the entire serialized alert data blob. This caused false positives where searching for "ethereum" matched chain names, "all" matchedchains: ['all'], and "send" matched event types.data.inclusion.tokensanddata.exclusion.tokensarrays, matching against theaddressfield specifically.Test plan
--token-addresscase-insensitive test still passes--token-address ethereumno longer false-positives against chain names--token-address allno longer false-positives againstchains: ['all']🤖 Generated with Claude Code