1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Wrote fix for eth.sign

This commit is contained in:
Dan Finlay 2017-01-16 23:26:48 -08:00
parent 7e886dff77
commit d5ad84aa12

View File

@ -54,8 +54,7 @@ class SimpleKeyring extends EventEmitter {
// For eth_sign, we need to sign transactions: // For eth_sign, we need to sign transactions:
signMessage (withAccount, data) { signMessage (withAccount, data) {
const wallet = this._getWalletForAccount(withAccount) const wallet = this._getWalletForAccount(withAccount)
const message = ethUtil.stripHexPrefix(data)
const message = ethUtil.removeHexPrefix(data)
var privKey = wallet.getPrivateKey() var privKey = wallet.getPrivateKey()
var msgSig = ethUtil.ecsign(new Buffer(message, 'hex'), privKey) var msgSig = ethUtil.ecsign(new Buffer(message, 'hex'), privKey)
var rawMsgSig = ethUtil.bufferToHex(sigUtil.concatSig(msgSig.v, msgSig.r, msgSig.s)) var rawMsgSig = ethUtil.bufferToHex(sigUtil.concatSig(msgSig.v, msgSig.r, msgSig.s))