Merge pull request #1487 from MetaMask/stopPolling

Stop polling
feature/default_network_editable
kumavis 8 years ago committed by GitHub
commit 664fc07800
  1. 1
      app/scripts/controllers/network.js
  2. 7
      test/unit/network-contoller-test.js

@ -53,6 +53,7 @@ module.exports = class NetworkController extends EventEmitter {
this.providerInit = newInit this.providerInit = newInit
this._provider.removeAllListeners() this._provider.removeAllListeners()
this._provider.stop()
this.provider = MetaMaskProvider(newInit) this.provider = MetaMaskProvider(newInit)
// apply the listners created by other controllers // apply the listners created by other controllers
Object.keys(this._providerListeners).forEach((key) => { Object.keys(this._providerListeners).forEach((key) => {

@ -1,4 +1,3 @@
const EventEmitter = require('events')
const assert = require('assert') const assert = require('assert')
const NetworkController = require('../../app/scripts/controllers/network') const NetworkController = require('../../app/scripts/controllers/network')
@ -12,7 +11,11 @@ describe('# Network Controller', function () {
}, },
}) })
// stub out provider // stub out provider
networkController._provider = new EventEmitter() networkController._provider = new Proxy({}, {
get: (obj, name) => {
return () => {}
},
})
networkController.providerInit = { networkController.providerInit = {
getAccounts: () => {}, getAccounts: () => {},
} }

Loading…
Cancel
Save