Skip to content

Commit

Permalink
bugfix(viem): wrong comparison operator when filtering logs (#500)
Browse files Browse the repository at this point in the history
* viem bugfix

* changeset
  • Loading branch information
hamdiallam authored Oct 9, 2024
1 parent c814823 commit d301e66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/violet-carpets-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@eth-optimism/viem": patch
---

bugfix when filtering the selector
2 changes: 1 addition & 1 deletion packages/viem/src/utils/l2ToL2CrossDomainMessenger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function createInteropSentL2ToL2Messages<
toHex('SentMessage(uint256,address,uint256,address,bytes)'),
)
const logs = params.receipt.logs.filter(
(log) => log.topics.length > 0 || log.topics[0] === selector,
(log) => log.topics.length > 0 && log.topics[0] === selector,
)
const messages = await Promise.all(
logs.map((log) => createInteropMessage(client, { log })),
Expand Down

0 comments on commit d301e66

Please sign in to comment.