diff options
author | kumavis <aaron@kumavis.me> | 2016-04-29 02:48:39 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2016-04-29 02:48:39 +0800 |
commit | d562b86f7af51cd303ead5ee9a76ac91a288e167 (patch) | |
tree | 800425c9f54f92c3f84606b19cd45bff3d8e4af8 | |
parent | 9b524b4f28bebbdf8351763b61e897f33021e25b (diff) | |
download | tangerine-wallet-browser-d562b86f7af51cd303ead5ee9a76ac91a288e167.tar.gz tangerine-wallet-browser-d562b86f7af51cd303ead5ee9a76ac91a288e167.tar.zst tangerine-wallet-browser-d562b86f7af51cd303ead5ee9a76ac91a288e167.zip |
tx list - bug fix - fixes #143
-rw-r--r-- | app/scripts/background.js | 5 | ||||
-rw-r--r-- | app/scripts/lib/idStore.js | 14 | ||||
-rw-r--r-- | package.json | 2 |
3 files changed, 15 insertions, 6 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js index 523df1261..83d0f575a 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -131,7 +131,10 @@ function onRpcRequest(remoteStream, payload){ // console.log('MetaMaskPlugin - incoming payload:', payload) provider.sendAsync(payload, function onPayloadHandled(err, response){ // provider engine errors are included in response objects - if (!payload.isMetamaskInternal) console.log('MetaMaskPlugin - RPC complete:', payload, '->', response) + if (!payload.isMetamaskInternal) { + console.log('MetaMaskPlugin - RPC complete:', payload, '->', response) + if (response.error) console.error('Error in RPC response:\n'+response.error.message) + } try { remoteStream.write(response) } catch (err) { diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index e9aaed82e..b462d4ad5 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -351,14 +351,20 @@ function IdManagement(opts) { txParams.nonce = ethUtil.addHexPrefix(txParams.nonce) var tx = new Transaction(txParams) + // sign tx + var privKeyHex = ethUtil.addHexPrefix(this.keyStore.exportPrivateKey(txParams.from, this.derivedKey, this.hdPathString)) + var privKey = ethUtil.toBuffer(privKeyHex) + tx.sign(privKey) + // Add the tx hash to the persisted meta-tx object - var hash = '0x' + tx.hash().toString('hex') + var txHash = ethUtil.bufferToHex(tx.hash()) var metaTx = configManager.getTx(txParams.metamaskId) - metaTx.hash = hash + metaTx.hash = txHash configManager.updateTx(metaTx) - var rawTx = '0x'+tx.serialize().toString('hex') - return '0x'+LightwalletSigner.signTx(this.keyStore, this.derivedKey, rawTx, txParams.from, this.hdPathString) + // return raw serialized tx + var rawTx = ethUtil.bufferToHex(tx.serialize()) + return rawTx } this.getSeed = function(){ diff --git a/package.json b/package.json index ae66621d3..c3f323d77 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "three.js": "^0.73.2", "through2": "^2.0.1", "web3": "^0.15.1", - "web3-provider-engine": "^7.5.0", + "web3-provider-engine": "^7.6.1", "xtend": "^4.0.1" }, "devDependencies": { |