-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Unknown Account #948
Comments
The versions are intentionally not synchronized, so the version of the sub-module is fine. :) I’m not sure what Is MetaMask enabled? Using the |
Hi Richard.
Yes you're right. This method is an implementation on my side. Basically it
retrieves an account. What I debugged is at this stage an account has been
selected. When I retrieve a signer with this account as a parameters it
works(explicit), without any parameter it doesn't work (implicit). It used
to work with previous versions. I don't have this problem on desktop
(metamask v8.0.x)
Thanks
…On Mon, 13 Jul 2020, 15:38 Richard Moore, ***@***.***> wrote:
The versions are intentionally not synchronized, so the version of the
sub-module is fine. :)
I’m not sure what this.getAccount is. Is that a function you added? Or
part of a framework or MetaMask?
Is MetaMask enabled? Using the await window.ethereum.enable()? The
MetaMask plug-in needs access enabled before any account operations can be
used. This is an API I would eventually like to add, but need to coordinate
a bit with the various client to make sure it works across the board.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#948 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE47PBGH6AM5IL7IZC4S6M3R3LMLBANCNFSM4OYKEGZA>
.
|
Is this still a problem? Was it a MetaMAsk issue? |
1 - I work around the issue when requesting a signer with an explicit selected account instead of the implicit selected account 2 - Metamask Mobile issued several releases in the mean time. Thanks for your support |
(out of curiosity, how do you get the explicit account to use? |
As I work with Metamask I have several ways to achieve it. |
I'm going to close this now as stale. I haven't tested it, but I'm guessing there is also some issue with If this is still a problem though, please re-open. Thanks! :) |
Just to bring this back up, It is still an issue. At expanse we have a public load balanced node. Its load balanced between 6 nodes in various locations and server farms. When using hardhat for testing, everything is fine. When we start to use the live net we get this error when calling methods on contracts. I noticed that 5 out of 6 times it was failing. I thought it was me. After like 4 hrs of debugging I realized the ONE difference on the ONE node was that it had a native account. That account is being used as account 0. If I connect directly to the node that has a native account 0, everything works like it should 100% of the time. Currently I'm doing..
For some reason this only works if the provider im connecting to already has a local account even though I thought I was supplying one. |
This does work though
If the wallet.address isnt provided then it tries to use getAddress on account 0 on the provider youre using. |
It probably doesn’t return a Signer that works though, does it? If you are connected to a public node, all you are doing is connecting to a providers internal accounts, and by passing in an explicit address you are telling it to not bypass any checks. But once you try using this signer to sign anything or send a transaction it should fail. |
You're right, im a doofus. So, passing it the entire wallet object works and lets you send a tx as well. |
|
If you call window.ethereum.enable() , it works perfectly! |
Environment Metamask Mobile -> v0.2.19
Ethers -> 5.0.5
Remote debugged with Chrome DevTools
This issue do not happen on Firefox and Chrome desktop.
It occurs only on Metamask Mobile.
1 - Ethers is loaded dynamically :
2 - Ethers is instantiated with the metamask provider and the getAccount trick
The account is properly retrieved
I use the 'any' parameter as advised here:
#899
I didn't do this test without this parameter though.
3 - Here is the code who crashes
Report:
1 - Ethers generates an exception :
Error: unknown account #0 (operation="getAddress", code=UNSUPPORTED_OPERATION, version=providers/5.0.4)
Minor remark -> the signature is still the 5.0.4 and not the 5.0.5
2 - Metamask Mobile generates as well an exception:
VM13:8 MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.
Workaround :
const signer = web3.getSigner(account)
When I explicitly set the account while retrieving the signer both exceptions are gone.
Thanks
The text was updated successfully, but these errors were encountered: