You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, stringToBytes (used by hashMessage when signing a message) takes the string and UTF-8 encodes the string and converts it to a byte array. This is a problem when trying to interface with a SimpleAccount because the generated signature is not correct. The expected signature is an ERC-191 signed hash of the UserOp.
This was was only an issue after 0.3.17
Expected Behavior
I'd expect stringToBytes to check if the string is already a Hex and then just call hexToBytes instead of UTF-8 encoding the hex string.
Steps To Reproduce
// This is one of the test private keys in this repoconstownerAccount=privateKeyToAccount("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80");expect(awaitownerAccount.signMessage({message: "0xa70d0af2ebb03a44dcd0714a8724f622e3ab876d0aa312f0ee04823285d6fb1b"})).toBe("0x1a7fd732f926be0a1dbfd1b4acbd7a6f7198fda1ab5ef69ef027a2eee89987785d210298e12119a1d62b5a7d2d9f24d075682675ae00f51a5602e725f0d180851b")
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Package Version
0.3.39
Current Behavior
Currently,
stringToBytes
(used byhashMessage
when signing a message) takes the string and UTF-8 encodes the string and converts it to a byte array. This is a problem when trying to interface with aSimpleAccount
because the generated signature is not correct. The expected signature is anERC-191
signed hash of the UserOp.This was was only an issue after
0.3.17
Expected Behavior
I'd expect
stringToBytes
to check if the string is already aHex
and then just callhexToBytes
instead of UTF-8 encoding the hex string.Steps To Reproduce
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: