-
Notifications
You must be signed in to change notification settings - Fork 13
Signer.getAddress() is not a function #3
Comments
Is this on v3 or v4 of ethers? I will be overhauling the bridge soon for v4... I’ll look more into getting this updated this week. :) |
It's |
Hey @ricmoo , just bouncing this thread. Thanks! |
Heya! I’ve started porting the bridge to v4., but thanks for the reminded, I’ll try to get it finished this week. :) |
This issue is very old, and it looks like ethers-web3-bridge is not actively maintained, but the use case holds. I'd like to do exactly the same thing @pakaplace. To test a Dapp with Cypress, I would like to mock Metamask, and be able to programmatically sign messages or transactions with ethers. Did you achieve this? Any pointer to how this would be feasible? |
You want the Eip1193Bridge. It’s still experimental, but I’ve used it a few times. :) |
(I need to add more documentation for it; the parameters are flipped compared to this old repo, |
Thank you so much Ric, will take a look at it :) |
No worries. I'll archive this project and add a link to the readme to the above package. :) |
This repo is deprecated; please see the v5 docs instead. |
Hi there!
First off, thank you so much for Ethers.js. I use it as much as possible throughout my app. I recently used it to automating contract deployment and account funding on test-rpc, which cut down our setup time for testing by at least an hour. I'll be sharing gists soon to help others, and plan on demonstrating ethers in a hackathon I'm mentoring at this fall.
Now, I'm trying to do injected web3 Dapp testing with Cypress, an end-to-end javascript testing framework similar to selenium.
window.web3 is setting properly^^
I create a web3 instance and log it out,
isConnected
is true andsigner
is set with the correct address. However, when I callwin.web3.eth.getAccounts()
, I encounter the errorsigner.getAddress() is not a function. The error is occurring in line 337 of this module's
index.js.
web3.eth.getBlockNumber()`, which does not require a signer, is working as it should.For more context, please see this article on web3 integration tests . Note that I could not replicate the code this author used in his example with
truffle-privatekey-provider
.I've tried using your
.connectEthers(Provider, Signer)
method as well.Thanks for your help!
The text was updated successfully, but these errors were encountered: