diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-04-01 01:33:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-01 01:33:04 +0800 |
commit | 0a5c634081656c9450d4341b96bab6b4134a0b7a (patch) | |
tree | 9c3aec4a62b88ad10c2971273df8ce03039b919c /app/scripts | |
parent | 862973dd67822b518842768ea8185d538d0f9800 (diff) | |
parent | 12918e18942a72223d7d97334934c31442e51caf (diff) | |
download | tangerine-wallet-browser-0a5c634081656c9450d4341b96bab6b4134a0b7a.tar tangerine-wallet-browser-0a5c634081656c9450d4341b96bab6b4134a0b7a.tar.gz tangerine-wallet-browser-0a5c634081656c9450d4341b96bab6b4134a0b7a.tar.bz2 tangerine-wallet-browser-0a5c634081656c9450d4341b96bab6b4134a0b7a.tar.lz tangerine-wallet-browser-0a5c634081656c9450d4341b96bab6b4134a0b7a.tar.xz tangerine-wallet-browser-0a5c634081656c9450d4341b96bab6b4134a0b7a.tar.zst tangerine-wallet-browser-0a5c634081656c9450d4341b96bab6b4134a0b7a.zip |
Merge pull request #1297 from MetaMask/eip155
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())) |