aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorThomas Huang <thomas.b.huang@gmail.com>2018-07-31 11:18:01 +0800
committerThomas Huang <thomas.b.huang@gmail.com>2018-07-31 11:18:01 +0800
commit2392e77cd8d0fff49a4c4f0c79539d990dd5dbd2 (patch)
tree54729aff61d6475d6faa6ada53e344af447f7fbf /test/unit
parent3d9f283f8720d5a2d1fb0cdd13ec4c95706866e5 (diff)
downloadtangerine-wallet-browser-2392e77cd8d0fff49a4c4f0c79539d990dd5dbd2.tar
tangerine-wallet-browser-2392e77cd8d0fff49a4c4f0c79539d990dd5dbd2.tar.gz
tangerine-wallet-browser-2392e77cd8d0fff49a4c4f0c79539d990dd5dbd2.tar.bz2
tangerine-wallet-browser-2392e77cd8d0fff49a4c4f0c79539d990dd5dbd2.tar.lz
tangerine-wallet-browser-2392e77cd8d0fff49a4c4f0c79539d990dd5dbd2.tar.xz
tangerine-wallet-browser-2392e77cd8d0fff49a4c4f0c79539d990dd5dbd2.tar.zst
tangerine-wallet-browser-2392e77cd8d0fff49a4c4f0c79539d990dd5dbd2.zip
Set metamask controller network provider to localhost
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/app/controllers/metamask-controller-test.js2
-rw-r--r--test/unit/app/controllers/transactions/tx-controller-test.js3
-rw-r--r--test/unit/localhostState.js21
3 files changed, 24 insertions, 2 deletions
diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js
index 0f51ed6cb..471321b9b 100644
--- a/test/unit/app/controllers/metamask-controller-test.js
+++ b/test/unit/app/controllers/metamask-controller-test.js
@@ -5,7 +5,7 @@ const nock = require('nock')
const createThoughStream = require('through2').obj
const blacklistJSON = require('eth-phishing-detect/src/config')
const MetaMaskController = require('../../../../app/scripts/metamask-controller')
-const firstTimeState = require('../../../../app/scripts/first-time-state')
+const firstTimeState = require('../../../unit/localhostState')
const createTxMeta = require('../../../lib/createTxMeta')
const currentNetworkId = 42
diff --git a/test/unit/app/controllers/transactions/tx-controller-test.js b/test/unit/app/controllers/transactions/tx-controller-test.js
index b62499a70..5ac813b49 100644
--- a/test/unit/app/controllers/transactions/tx-controller-test.js
+++ b/test/unit/app/controllers/transactions/tx-controller-test.js
@@ -382,8 +382,9 @@ describe('Transaction Controller', function () {
})
it('should publish a tx, updates the rawTx when provided a one', async function () {
+ const rawTx = '0x477b2e6553c917af0db0388ae3da62965ff1a184558f61b749d1266b2e6d024c'
txController.txStateManager.addTx(txMeta)
- await txController.publishTransaction(txMeta.id)
+ await txController.publishTransaction(txMeta.id, rawTx)
const publishedTx = txController.txStateManager.getTx(1)
assert.equal(publishedTx.hash, hash)
assert.equal(publishedTx.status, 'submitted')
diff --git a/test/unit/localhostState.js b/test/unit/localhostState.js
new file mode 100644
index 000000000..ea0fa9194
--- /dev/null
+++ b/test/unit/localhostState.js
@@ -0,0 +1,21 @@
+
+/**
+ * @typedef {Object} FirstTimeState
+ * @property {Object} config Initial configuration parameters
+ * @property {Object} NetworkController Network controller state
+ */
+
+/**
+ * @type {FirstTimeState}
+ */
+const initialState = {
+ config: {},
+ NetworkController: {
+ provider: {
+ type: 'rpc',
+ rpcTarget: 'http://localhost:8545'
+ }
+ },
+}
+
+module.exports = initialState