|
|
@ -26,7 +26,7 @@ function IdManagement (opts) { |
|
|
|
this.signTx = function (txParams) { |
|
|
|
this.signTx = function (txParams) { |
|
|
|
// normalize values
|
|
|
|
// normalize values
|
|
|
|
txParams.to = ethUtil.addHexPrefix(txParams.to) |
|
|
|
txParams.to = ethUtil.addHexPrefix(txParams.to) |
|
|
|
txParams.from = ethUtil.addHexPrefix(txParams.from) |
|
|
|
txParams.from = ethUtil.addHexPrefix(txParams.from.toLowerCase()) |
|
|
|
txParams.value = ethUtil.addHexPrefix(txParams.value) |
|
|
|
txParams.value = ethUtil.addHexPrefix(txParams.value) |
|
|
|
txParams.data = ethUtil.addHexPrefix(txParams.data) |
|
|
|
txParams.data = ethUtil.addHexPrefix(txParams.data) |
|
|
|
txParams.gasLimit = ethUtil.addHexPrefix(txParams.gasLimit || txParams.gas) |
|
|
|
txParams.gasLimit = ethUtil.addHexPrefix(txParams.gasLimit || txParams.gas) |
|
|
@ -51,7 +51,7 @@ function IdManagement (opts) { |
|
|
|
|
|
|
|
|
|
|
|
this.signMsg = function (address, message) { |
|
|
|
this.signMsg = function (address, message) { |
|
|
|
// sign message
|
|
|
|
// sign message
|
|
|
|
var privKeyHex = this.exportPrivateKey(address) |
|
|
|
var privKeyHex = this.exportPrivateKey(address.toLowerCase()) |
|
|
|
var privKey = ethUtil.toBuffer(privKeyHex) |
|
|
|
var privKey = ethUtil.toBuffer(privKeyHex) |
|
|
|
var msgSig = ethUtil.ecsign(new Buffer(message.replace('0x', ''), 'hex'), privKey) |
|
|
|
var msgSig = ethUtil.ecsign(new Buffer(message.replace('0x', ''), 'hex'), privKey) |
|
|
|
var rawMsgSig = ethUtil.bufferToHex(concatSig(msgSig.v, msgSig.r, msgSig.s)) |
|
|
|
var rawMsgSig = ethUtil.bufferToHex(concatSig(msgSig.v, msgSig.r, msgSig.s)) |
|
|
|