diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-06-13 10:34:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-13 10:34:43 +0800 |
commit | eccb8b8f80b9d8bda70106bd3a089d059ea9d44f (patch) | |
tree | 2171748d9256cb180035bf431c80c82313a93cd8 | |
parent | bbe0c73dca45542b519036bec2bae5feb1e55485 (diff) | |
parent | c0f07844af434666ae1e511e90e36ca493e8bb91 (diff) | |
download | tangerine-wallet-browser-eccb8b8f80b9d8bda70106bd3a089d059ea9d44f.tar tangerine-wallet-browser-eccb8b8f80b9d8bda70106bd3a089d059ea9d44f.tar.gz tangerine-wallet-browser-eccb8b8f80b9d8bda70106bd3a089d059ea9d44f.tar.bz2 tangerine-wallet-browser-eccb8b8f80b9d8bda70106bd3a089d059ea9d44f.tar.lz tangerine-wallet-browser-eccb8b8f80b9d8bda70106bd3a089d059ea9d44f.tar.xz tangerine-wallet-browser-eccb8b8f80b9d8bda70106bd3a089d059ea9d44f.tar.zst tangerine-wallet-browser-eccb8b8f80b9d8bda70106bd3a089d059ea9d44f.zip |
Merge pull request #1601 from MetaMask/ChainIdErrorTest
Chain id error test
-rw-r--r-- | app/scripts/controllers/transactions.js | 2 | ||||
-rw-r--r-- | test/unit/tx-controller-test.js | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index faccf1ab1..d4603aafa 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -212,7 +212,7 @@ module.exports = class TransactionController extends EventEmitter { getChainId () { const networkState = this.networkStore.getState() - const getChainId = parseInt(networkState.network) + const getChainId = parseInt(networkState) if (Number.isNaN(getChainId)) { return 0 } else { diff --git a/test/unit/tx-controller-test.js b/test/unit/tx-controller-test.js index 3954300a8..f0d8a706e 100644 --- a/test/unit/tx-controller-test.js +++ b/test/unit/tx-controller-test.js @@ -311,12 +311,13 @@ describe('Transaction Controller', function () { }) describe('#sign replay-protected tx', function () { - it('prepares a tx with the chainId set', function () { + it('prepares a tx with the chainId set', function (done) { txController.addTx({ id: '1', status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: {} }, noop) txController.signTransaction('1', (err, rawTx) => { - if (err) return assert.fail('it should not fail') + if (err) return done('it should not fail') const ethTx = new EthTx(ethUtil.toBuffer(rawTx)) assert.equal(ethTx.getChainId(), currentNetworkId) + done() }) }) }) |