-
Notifications
You must be signed in to change notification settings - Fork 36
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
Support signing non-hex messages #804
Conversation
src/ethereum/EthereumEngine.ts
Outdated
const messageBuffer = hexToBuf(message) | ||
const messageBuffer = isHex(message) | ||
? hexToBuf(message) | ||
: Buffer.from(message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's a good idea to use Buffer.from without specifying the encoding. Instead maybe explicitly test for different types of strings and use base16 and base64 to create the uint8array and to support arbitrary text by using Buffer.from(arg, 'ascii')
31989db
to
c0afe35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependencies updated. Now leaving signMessage unchanged, and implementing a generic signBytes()
src/ethereum/EthereumEngine.ts
Outdated
@@ -143,8 +144,19 @@ export class EthereumEngine extends CurrencyEngine< | |||
] | |||
|
|||
this.utils = { | |||
signBytes: (bytes: Uint8Array, privateKeys: EthereumPrivateKeys) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove signBytes and signMessage from utils
9b0122d
to
36edf19
Compare
Required for signing Bity orders
36edf19
to
2bba3e4
Compare
Required for signing Bity orders
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
EdgeApp/edge-core-js#605
Description
none