diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-04-29 02:51:52 +0800 |
---|---|---|
committer | kumavis <kumavis@users.noreply.github.com> | 2016-04-29 02:51:52 +0800 |
commit | 6cc7c08b75bed6ad95698b96cb788366a8334ecd (patch) | |
tree | 800425c9f54f92c3f84606b19cd45bff3d8e4af8 /app/scripts/lib/idStore.js | |
parent | 9b524b4f28bebbdf8351763b61e897f33021e25b (diff) | |
parent | d562b86f7af51cd303ead5ee9a76ac91a288e167 (diff) | |
download | tangerine-wallet-browser-6cc7c08b75bed6ad95698b96cb788366a8334ecd.tar tangerine-wallet-browser-6cc7c08b75bed6ad95698b96cb788366a8334ecd.tar.gz tangerine-wallet-browser-6cc7c08b75bed6ad95698b96cb788366a8334ecd.tar.bz2 tangerine-wallet-browser-6cc7c08b75bed6ad95698b96cb788366a8334ecd.tar.lz tangerine-wallet-browser-6cc7c08b75bed6ad95698b96cb788366a8334ecd.tar.xz tangerine-wallet-browser-6cc7c08b75bed6ad95698b96cb788366a8334ecd.tar.zst tangerine-wallet-browser-6cc7c08b75bed6ad95698b96cb788366a8334ecd.zip |
Merge pull request #158 from MetaMask/eth_Sign
tx list - bug fix - fixes #143
Diffstat (limited to 'app/scripts/lib/idStore.js')
-rw-r--r-- | app/scripts/lib/idStore.js | 14 |
1 files changed, 10 insertions, 4 deletions
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(){ |