diff options
author | kumavis <aaron@kumavis.me> | 2017-03-31 05:23:23 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2017-03-31 05:23:23 +0800 |
commit | 1dce352523a1f79f052ef79c707d9bc44787b706 (patch) | |
tree | e379889bd25620b1f75fe6d0d20fe6a625bc7854 /app/scripts | |
parent | 738201e8e5d829282363dda4bc0480dec7245f4a (diff) | |
download | tangerine-wallet-browser-1dce352523a1f79f052ef79c707d9bc44787b706.tar.gz tangerine-wallet-browser-1dce352523a1f79f052ef79c707d9bc44787b706.tar.zst tangerine-wallet-browser-1dce352523a1f79f052ef79c707d9bc44787b706.zip |
tx-manager - add eip155 support
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/transaction-manager.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js index a70159680..d7051b2cb 100644 --- a/app/scripts/transaction-manager.js +++ b/app/scripts/transaction-manager.js @@ -205,11 +205,23 @@ module.exports = class TransactionManager extends EventEmitter { }) } + getChainId() { + const networkState = this.networkStore.getState() + const getChainId = parseInt(networkState.network) + if (Number.isNaN(getChainId)) { + return 0 + } else { + return getChainId + } + } + signTransaction (txId, cb) { - let txMeta = this.getTx(txId) - let txParams = txMeta.txParams - let fromAddress = txParams.from - let ethTx = this.txProviderUtils.buildEthTxFromParams(txParams) + const txMeta = this.getTx(txId) + const txParams = txMeta.txParams + const fromAddress = txParams.from + // add network/chain id + txParams.chainId = this.getChainId() + const ethTx = this.txProviderUtils.buildEthTxFromParams(txParams) this.signEthTx(ethTx, fromAddress).then(() => { this.setTxStatusSigned(txMeta.id) cb(null, ethUtil.bufferToHex(ethTx.serialize())) |