feature/default_network_editable
kumavis 7 years ago
parent 088d7930e0
commit b6eff15bd2
  1. 5
      app/scripts/controllers/network/createInfuraClient.js
  2. 4
      app/scripts/controllers/network/createJsonRpcClient.js
  3. 2
      app/scripts/controllers/network/createLocalhostClient.js
  4. 4
      app/scripts/controllers/network/createMetamaskMiddleware.js
  5. 4
      app/scripts/controllers/network/network.js

@ -1,7 +1,10 @@
const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware') const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware') const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware')
const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-ref') const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-ref')
const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-cache') const createBlockCacheMiddleware = require('eth-json-rpc-middleware/block-cache')
const createInflightMiddleware = require('eth-json-rpc-middleware/inflight')
const providerFromMiddleware = require('eth-json-rpc-middleware/providerFromMiddleware')
const createInfuraMiddleware = require('eth-json-rpc-infura')
const BlockTracker = require('eth-block-tracker') const BlockTracker = require('eth-block-tracker')
module.exports = createInfuraClient module.exports = createInfuraClient

@ -2,7 +2,9 @@ const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware') const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware')
const createFetchMiddleware = require('eth-json-rpc-middleware/fetch') const createFetchMiddleware = require('eth-json-rpc-middleware/fetch')
const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-ref') const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-ref')
const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-cache') const createBlockCacheMiddleware = require('eth-json-rpc-middleware/block-cache')
const createInflightMiddleware = require('eth-json-rpc-middleware/inflight')
const providerFromMiddleware = require('eth-json-rpc-middleware/providerFromMiddleware')
const BlockTracker = require('eth-block-tracker') const BlockTracker = require('eth-block-tracker')
module.exports = createJsonRpcClient module.exports = createJsonRpcClient

@ -2,7 +2,7 @@ const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware') const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware')
const createFetchMiddleware = require('eth-json-rpc-middleware/fetch') const createFetchMiddleware = require('eth-json-rpc-middleware/fetch')
const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-ref') const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-ref')
const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-cache') const providerFromMiddleware = require('eth-json-rpc-middleware/providerFromMiddleware')
const BlockTracker = require('eth-block-tracker') const BlockTracker = require('eth-block-tracker')
module.exports = createLocalhostClient module.exports = createLocalhostClient

@ -12,7 +12,7 @@ function createMetamaskMiddleware({
processEthSignMessage, processEthSignMessage,
processTypedMessage, processTypedMessage,
processPersonalMessage, processPersonalMessage,
getPendingNonce getPendingNonce,
}) { }) {
const metamaskMiddleware = mergeMiddleware([ const metamaskMiddleware = mergeMiddleware([
createScaffoldMiddleware({ createScaffoldMiddleware({
@ -28,7 +28,7 @@ function createMetamaskMiddleware({
processPersonalMessage, processPersonalMessage,
}), }),
createPendingNonceMiddleware({ getPendingNonce }), createPendingNonceMiddleware({ getPendingNonce }),
}) ])
return metamaskMiddleware return metamaskMiddleware
} }

@ -2,8 +2,9 @@ const assert = require('assert')
const EventEmitter = require('events') const EventEmitter = require('events')
const ObservableStore = require('obs-store') const ObservableStore = require('obs-store')
const ComposedStore = require('obs-store/lib/composed') const ComposedStore = require('obs-store/lib/composed')
const extend = require('xtend')
const EthQuery = require('eth-query') const EthQuery = require('eth-query')
const JsonRpcEngine = require('json-rpc-engine')
const providerFromEngine = require('eth-json-rpc-middle/providerFromEngine')
const log = require('loglevel') const log = require('loglevel')
const createMetamaskMiddleware = require('./createMetamaskMiddleware') const createMetamaskMiddleware = require('./createMetamaskMiddleware')
const createInfuraClient = require('./createInfuraClient') const createInfuraClient = require('./createInfuraClient')
@ -19,7 +20,6 @@ const {
MAINNET, MAINNET,
LOCALHOST, LOCALHOST,
} = require('./enums') } = require('./enums')
const LOCALHOST_RPC_URL = 'http://localhost:8545'
const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET] const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET]
const env = process.env.METAMASK_ENV const env = process.env.METAMASK_ENV

Loading…
Cancel
Save