aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-03-06 06:25:04 +0800
committerkumavis <aaron@kumavis.me>2016-03-06 06:25:33 +0800
commitcbde4157aaab8fec46b2e87206360adfc7e91fbc (patch)
tree7a27793981da289af5a586dccebffbaf317e9347 /app
parent77eaf8b0f57151750952184cd6c0adfef8636e37 (diff)
downloadtangerine-wallet-browser-cbde4157aaab8fec46b2e87206360adfc7e91fbc.tar
tangerine-wallet-browser-cbde4157aaab8fec46b2e87206360adfc7e91fbc.tar.gz
tangerine-wallet-browser-cbde4157aaab8fec46b2e87206360adfc7e91fbc.tar.bz2
tangerine-wallet-browser-cbde4157aaab8fec46b2e87206360adfc7e91fbc.tar.lz
tangerine-wallet-browser-cbde4157aaab8fec46b2e87206360adfc7e91fbc.tar.xz
tangerine-wallet-browser-cbde4157aaab8fec46b2e87206360adfc7e91fbc.tar.zst
tangerine-wallet-browser-cbde4157aaab8fec46b2e87206360adfc7e91fbc.zip
idStore - normalize hex format before signing
Diffstat (limited to 'app')
-rw-r--r--app/scripts/lib/idStore.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 366372442..f31d4562d 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -228,7 +228,13 @@ IdentityStore.prototype._createIdmgmt = function(password, cb){
return keyStore.getAddresses().map(function(address){ return '0x'+address })
},
signTx: function(txParams){
- txParams.gasLimit = txParams.gas
+ // normalize values
+ txParams.to = ethUtil.addHexPrefix(txParams.to)
+ txParams.from = ethUtil.addHexPrefix(txParams.from)
+ txParams.value = ethUtil.addHexPrefix(txParams.value)
+ txParams.data = ethUtil.addHexPrefix(txParams.data)
+ txParams.gasLimit = ethUtil.addHexPrefix(txParams.gasLimit || txParams.gas)
+ txParams.nonce = ethUtil.addHexPrefix(txParams.nonce)
var tx = new Transaction(txParams)
var rawTx = '0x'+tx.serialize().toString('hex')
return '0x'+LightwalletSigner.signTx(keyStore, derrivedKey, rawTx, txParams.from)