Skip to content

Commit

Permalink
fix: eventName not properly set in createWatchContractEvent (#4400)
Browse files Browse the repository at this point in the history
* Fix functionName instead of eventName

* chore: changeset

---------

Co-authored-by: Tom Meagher <[email protected]>
  • Loading branch information
AzzouQ and tmm authored Nov 11, 2024
1 parent dac62dc commit 6b9bbac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-tigers-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/core": patch
---

Fixed `createWatchContractEvent` internal wiring, where `eventName` was incorrectly `functionName`.
4 changes: 2 additions & 2 deletions packages/core/src/actions/codegen/createWatchContractEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function createWatchContractEvent<
configChainId
return watchContractEvent(config, {
...(parameters as any),
...(c.eventName ? { functionName: c.eventName } : {}),
...(c.eventName ? { eventName: c.eventName } : {}),
address: c.address?.[chainId],
abi: c.abi,
})
Expand All @@ -81,7 +81,7 @@ export function createWatchContractEvent<
return watchContractEvent(config, {
...(parameters as any),
...(c.address ? { address: c.address } : {}),
...(c.eventName ? { functionName: c.eventName } : {}),
...(c.eventName ? { eventName: c.eventName } : {}),
abi: c.abi,
})
}
Expand Down

0 comments on commit 6b9bbac

Please sign in to comment.