-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ethersjs v6 AddressLike type in hardhat-chai-matchers #4097
Comments
Hi @RenanSouza2, which matchers do you think should support AddressLike values? Some examples would be great. We accept contracts right now, but maybe this is about expanding those types to allow more general Addressable things. |
In this repository I wrote some examples: https://github.com/RenanSouza2/chai-matchers-example/blob/main/test/Lock.ts the examples I would like are in comparing returned addresses from contracts to signers and in the 'withArgs' of events matchers and revertedWithCustomError |
Where is this implemented? I can't find it in the code. |
@RenanSouza2 thanks for the examples. I agree that having those in the @frangio for example, you can do this: await expect(foo.inc()).to.changeEtherBalance(foo, 0) or this: await expect(foo.inc()).to.changeEtherBalance(await foo.getAddress(), 0) That's implemented here. |
Makes sense, and besides '.target'there could also work with the '.address'of the 'SignerWithAddress' type. If there is anything I can do to help here, let me know |
#4449 should fix that issue. Open to feedback ! |
Describe the feature
ethersjs v6 implements a AddressLike type that improoves the UX by allowing to pass an signer or contract object where an address is expected
hardhat-chai-matchers still expects a string for an address so I suggest using the same treatment,
I thought this was implemented in the ethers.io project so I fist opened this issue: ethers-io/ethers.js#4191
Search terms
No response
The text was updated successfully, but these errors were encountered: