1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

Set metamask controller network provider to localhost

This commit is contained in:
Thomas Huang 2018-07-30 20:18:01 -07:00
parent 3d9f283f87
commit 2392e77cd8
3 changed files with 24 additions and 2 deletions

View File

@ -5,7 +5,7 @@ const nock = require('nock')
const createThoughStream = require('through2').obj const createThoughStream = require('through2').obj
const blacklistJSON = require('eth-phishing-detect/src/config') const blacklistJSON = require('eth-phishing-detect/src/config')
const MetaMaskController = require('../../../../app/scripts/metamask-controller') 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 createTxMeta = require('../../../lib/createTxMeta')
const currentNetworkId = 42 const currentNetworkId = 42

View File

@ -382,8 +382,9 @@ describe('Transaction Controller', function () {
}) })
it('should publish a tx, updates the rawTx when provided a one', async function () { it('should publish a tx, updates the rawTx when provided a one', async function () {
const rawTx = '0x477b2e6553c917af0db0388ae3da62965ff1a184558f61b749d1266b2e6d024c'
txController.txStateManager.addTx(txMeta) txController.txStateManager.addTx(txMeta)
await txController.publishTransaction(txMeta.id) await txController.publishTransaction(txMeta.id, rawTx)
const publishedTx = txController.txStateManager.getTx(1) const publishedTx = txController.txStateManager.getTx(1)
assert.equal(publishedTx.hash, hash) assert.equal(publishedTx.hash, hash)
assert.equal(publishedTx.status, 'submitted') assert.equal(publishedTx.status, 'submitted')

View File

@ -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