-
Notifications
You must be signed in to change notification settings - Fork 4.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
eth_sign won't resolve promise #10961
Comments
Are there any errors in the dapp console that can reference an implementation issue? I ask because simply running the
|
I was mistaken, the So this should work.
eth.wiki/#eth_sign says it can take N bytes, but the docs can be old. But from what I can see our implementation is not currently in spec with secp256k1. |
Thanks for the help @tmashuang It does resolve now but the signature verification fails: https://github.com/joelamouche/test-dapp/blob/95ac0a4cd3d12d5934812b23653aec991d5133e8/src/connect.ts#L79 Is there a signature verification test I could take inspiration from? Thanks in advance |
I was actually able to verify using ethUtil.bufferToHex(Buffer.from(testMsg)) from ethereumjs-util (see permalink above) |
@tmashuang what is the authorized length? I'm trying to sign a 216 long byte msg and it never resolves, much like it used to for short messages |
@tmashuang Is there a way we can change that limit please ? |
@tmashuang nevermind I hashed it and it works |
I am also seeing the same issue. |
@wjmelements @joelamouche , so what was your solution ? how are u hashing it ? |
@vanvantsyan See https://github.com/polkadot-js/extension/blob/51a4eabed8293ea92b456f0f493c7c5ea55b81d5/packages/extension-compat-metamask/src/index.ts#L77 I used |
I used If you want to see sample See https://github.com/sinsinpurin/metamask-sign-test |
Describe the bug
const signedMsg = await provider.request({ method: 'eth_sign',params:[accountsRead[0],"test"] });
won't resolve and stays pending even if the call does trigger a signature in MetaMask and does show the appropriate warning.Steps to reproduce (REQUIRED)
Steps to reproduce the behavior, libraries used with version number, and/or any setup information to easily reproduce:
yarn start
You should be able to see "SIGNED" in the console, as per https://github.com/joelamouche/test-dapp/blob/b40dda41246a44f07087852fcfef6e4b480bdfbb/src/connect.ts#L71
Expected behavior
You should be able to see "SIGNED" in the console, as per https://github.com/joelamouche/test-dapp/blob/b40dda41246a44f07087852fcfef6e4b480bdfbb/src/connect.ts#L71
And see the signed message
Also I do want to specify that @danfinlay said that eth_sign should be implemented in MetaMask/metamask-docs#239
Browser details (please complete the following information):
The text was updated successfully, but these errors were encountered: