Skip to content

Commit

Permalink
fix: use eventName instead of functionName (#3410)
Browse files Browse the repository at this point in the history
* fix: use eventName instead of functionName

use `eventName` instead of `functionName` when generating contract events code.

Closes: #3409

* Create patch changeset

* Update .changeset/lazy-lemons-act.md

---------

Co-authored-by: awkweb <[email protected]>
  • Loading branch information
o-az and tmm authored Jan 9, 2024
1 parent a82a759 commit 55e31c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lazy-lemons-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/cli": patch
---

Fixed actions plugin issue where `functionName` was used instead of `eventName` for generated contract event actions.
2 changes: 1 addition & 1 deletion packages/cli/src/plugins/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export const ${actionName} = ${pure} ${functionName}({ ${innerContent} })`,
})
content.push(
`${docString}
export const ${actionName} = ${pure} ${functionName}({ ${innerContent}, functionName: '${item.name}' })`,
export const ${actionName} = ${pure} ${functionName}({ ${innerContent}, eventName: '${item.name}' })`,
)
}
}
Expand Down

1 comment on commit 55e31c3

@vercel
Copy link

@vercel vercel bot commented on 55e31c3 Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.