mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
commit
4289f813e9
@ -1,79 +0,0 @@
|
||||
const MAINET_RPC_URL = 'https://mainnet.infura.io/metamask'
|
||||
const ROPSTEN_RPC_URL = 'https://ropsten.infura.io/metamask'
|
||||
const KOVAN_RPC_URL = 'https://kovan.infura.io/metamask'
|
||||
const RINKEBY_RPC_URL = 'https://rinkeby.infura.io/metamask'
|
||||
const LOCALHOST_RPC_URL = 'http://localhost:8545'
|
||||
|
||||
const MAINET_RPC_URL_BETA = 'https://mainnet.infura.io/metamask2'
|
||||
const ROPSTEN_RPC_URL_BETA = 'https://ropsten.infura.io/metamask2'
|
||||
const KOVAN_RPC_URL_BETA = 'https://kovan.infura.io/metamask2'
|
||||
const RINKEBY_RPC_URL_BETA = 'https://rinkeby.infura.io/metamask2'
|
||||
|
||||
const DEFAULT_RPC = 'rinkeby'
|
||||
const OLD_UI_NETWORK_TYPE = 'network'
|
||||
const BETA_UI_NETWORK_TYPE = 'networkBeta'
|
||||
|
||||
global.METAMASK_DEBUG = process.env.METAMASK_DEBUG
|
||||
|
||||
/**
|
||||
* @typedef {Object} UrlConfig
|
||||
* @property {string} localhost URL of local RPC provider
|
||||
* @property {string} mainnet URL of mainnet RPC provider
|
||||
* @property {string} ropsten URL of Ropsten testnet RPC provider
|
||||
* @property {string} kovan URL of Kovan testnet RPC provider
|
||||
* @property {string} rinkeby URL of Rinkeby testnet RPC provider
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} NameConfig
|
||||
* @property {string} 3 URL of local RPC provider
|
||||
* @property {string} 4 URL of mainnet RPC provider
|
||||
* @property {string} 42 URL of Ropsten testnet RPC provider
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} EnumConfig
|
||||
* @property {string} DEFAULT_RPC Default network provider URL
|
||||
* @property {string} OLD_UI_NETWORK_TYPE Network associated with old UI
|
||||
* @property {string} BETA_UI_NETWORK_TYPE Network associated with new UI
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} Config
|
||||
* @property {UrlConfig} network Network configuration parameters
|
||||
* @property {UrlConfig} networkBeta Beta UI network configuration parameters
|
||||
* @property {NameConfig} networkNames Network name configuration parameters
|
||||
* @property {EnumConfig} enums Application-wide string constants
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {Config}
|
||||
**/
|
||||
const config = {
|
||||
network: {
|
||||
localhost: LOCALHOST_RPC_URL,
|
||||
mainnet: MAINET_RPC_URL,
|
||||
ropsten: ROPSTEN_RPC_URL,
|
||||
kovan: KOVAN_RPC_URL,
|
||||
rinkeby: RINKEBY_RPC_URL,
|
||||
},
|
||||
networkBeta: {
|
||||
localhost: LOCALHOST_RPC_URL,
|
||||
mainnet: MAINET_RPC_URL_BETA,
|
||||
ropsten: ROPSTEN_RPC_URL_BETA,
|
||||
kovan: KOVAN_RPC_URL_BETA,
|
||||
rinkeby: RINKEBY_RPC_URL_BETA,
|
||||
},
|
||||
networkNames: {
|
||||
3: 'Ropsten',
|
||||
4: 'Rinkeby',
|
||||
42: 'Kovan',
|
||||
},
|
||||
enums: {
|
||||
DEFAULT_RPC,
|
||||
OLD_UI_NETWORK_TYPE,
|
||||
BETA_UI_NETWORK_TYPE,
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = config
|
56
app/scripts/controllers/network/enums.js
Normal file
56
app/scripts/controllers/network/enums.js
Normal file
@ -0,0 +1,56 @@
|
||||
const ROPSTEN = 'ropsten'
|
||||
const RINKEBY = 'rinkeby'
|
||||
const KOVAN = 'kovan'
|
||||
const MAINNET = 'mainnet'
|
||||
const LOCALHOST = 'localhost'
|
||||
|
||||
const ROPSTEN_CODE = 3
|
||||
const RINKEYBY_CODE = 4
|
||||
const KOVAN_CODE = 42
|
||||
|
||||
const ROPSTEN_DISPLAY_NAME = 'Ropsten'
|
||||
const RINKEBY_DISPLAY_NAME = 'Rinkeby'
|
||||
const KOVAN_DISPLAY_NAME = 'Kovan'
|
||||
const MAINNET_DISPLAY_NAME = 'Main Ethereum Network'
|
||||
|
||||
const MAINNET_RPC_URL = 'https://mainnet.infura.io/metamask'
|
||||
const ROPSTEN_RPC_URL = 'https://ropsten.infura.io/metamask'
|
||||
const KOVAN_RPC_URL = 'https://kovan.infura.io/metamask'
|
||||
const RINKEBY_RPC_URL = 'https://rinkeby.infura.io/metamask'
|
||||
const LOCALHOST_RPC_URL = 'http://localhost:8545'
|
||||
|
||||
const MAINNET_RPC_URL_BETA = 'https://mainnet.infura.io/metamask2'
|
||||
const ROPSTEN_RPC_URL_BETA = 'https://ropsten.infura.io/metamask2'
|
||||
const KOVAN_RPC_URL_BETA = 'https://kovan.infura.io/metamask2'
|
||||
const RINKEBY_RPC_URL_BETA = 'https://rinkeby.infura.io/metamask2'
|
||||
|
||||
const DEFAULT_NETWORK = 'rinkeby'
|
||||
const OLD_UI_NETWORK_TYPE = 'network'
|
||||
const BETA_UI_NETWORK_TYPE = 'networkBeta'
|
||||
|
||||
module.exports = {
|
||||
ROPSTEN,
|
||||
RINKEBY,
|
||||
KOVAN,
|
||||
MAINNET,
|
||||
LOCALHOST,
|
||||
ROPSTEN_CODE,
|
||||
RINKEYBY_CODE,
|
||||
KOVAN_CODE,
|
||||
ROPSTEN_DISPLAY_NAME,
|
||||
RINKEBY_DISPLAY_NAME,
|
||||
KOVAN_DISPLAY_NAME,
|
||||
MAINNET_DISPLAY_NAME,
|
||||
MAINNET_RPC_URL,
|
||||
ROPSTEN_RPC_URL,
|
||||
KOVAN_RPC_URL,
|
||||
RINKEBY_RPC_URL,
|
||||
LOCALHOST_RPC_URL,
|
||||
MAINNET_RPC_URL_BETA,
|
||||
ROPSTEN_RPC_URL_BETA,
|
||||
KOVAN_RPC_URL_BETA,
|
||||
RINKEBY_RPC_URL_BETA,
|
||||
DEFAULT_NETWORK,
|
||||
OLD_UI_NETWORK_TYPE,
|
||||
BETA_UI_NETWORK_TYPE,
|
||||
}
|
2
app/scripts/controllers/network/index.js
Normal file
2
app/scripts/controllers/network/index.js
Normal file
@ -0,0 +1,2 @@
|
||||
const NetworkController = require('./network')
|
||||
module.exports = NetworkController
|
@ -7,11 +7,18 @@ const ObservableStore = require('obs-store')
|
||||
const ComposedStore = require('obs-store/lib/composed')
|
||||
const extend = require('xtend')
|
||||
const EthQuery = require('eth-query')
|
||||
const createEventEmitterProxy = require('../lib/events-proxy.js')
|
||||
const networkConfig = require('../config.js')
|
||||
const createEventEmitterProxy = require('../../lib/events-proxy.js')
|
||||
const log = require('loglevel')
|
||||
const { OLD_UI_NETWORK_TYPE, DEFAULT_RPC } = networkConfig.enums
|
||||
const INFURA_PROVIDER_TYPES = ['ropsten', 'rinkeby', 'kovan', 'mainnet']
|
||||
const {
|
||||
ROPSTEN,
|
||||
RINKEBY,
|
||||
KOVAN,
|
||||
MAINNET,
|
||||
OLD_UI_NETWORK_TYPE,
|
||||
DEFAULT_NETWORK,
|
||||
} = require('./enums')
|
||||
const { getNetworkEndpoints } = require('./util')
|
||||
const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET]
|
||||
|
||||
module.exports = class NetworkController extends EventEmitter {
|
||||
|
||||
@ -19,8 +26,8 @@ module.exports = class NetworkController extends EventEmitter {
|
||||
super()
|
||||
|
||||
this._networkEndpointVersion = OLD_UI_NETWORK_TYPE
|
||||
this._networkEndpoints = this.getNetworkEndpoints(OLD_UI_NETWORK_TYPE)
|
||||
this._defaultRpc = this._networkEndpoints[DEFAULT_RPC]
|
||||
this._networkEndpoints = getNetworkEndpoints(OLD_UI_NETWORK_TYPE)
|
||||
this._defaultRpc = this._networkEndpoints[DEFAULT_NETWORK]
|
||||
|
||||
config.provider.rpcTarget = this.getRpcAddressForType(config.provider.type, config.provider)
|
||||
this.networkStore = new ObservableStore('loading')
|
||||
@ -37,17 +44,13 @@ module.exports = class NetworkController extends EventEmitter {
|
||||
}
|
||||
|
||||
this._networkEndpointVersion = version
|
||||
this._networkEndpoints = this.getNetworkEndpoints(version)
|
||||
this._defaultRpc = this._networkEndpoints[DEFAULT_RPC]
|
||||
this._networkEndpoints = getNetworkEndpoints(version)
|
||||
this._defaultRpc = this._networkEndpoints[DEFAULT_NETWORK]
|
||||
const { type } = this.getProviderConfig()
|
||||
|
||||
return this.setProviderType(type, true)
|
||||
}
|
||||
|
||||
getNetworkEndpoints (version = OLD_UI_NETWORK_TYPE) {
|
||||
return networkConfig[version]
|
||||
}
|
||||
|
||||
initializeProvider (_providerParams) {
|
||||
this._baseProviderParams = _providerParams
|
||||
const { type, rpcTarget } = this.providerStore.getState()
|
65
app/scripts/controllers/network/util.js
Normal file
65
app/scripts/controllers/network/util.js
Normal file
@ -0,0 +1,65 @@
|
||||
const {
|
||||
ROPSTEN,
|
||||
RINKEBY,
|
||||
KOVAN,
|
||||
MAINNET,
|
||||
LOCALHOST,
|
||||
ROPSTEN_CODE,
|
||||
RINKEYBY_CODE,
|
||||
KOVAN_CODE,
|
||||
ROPSTEN_DISPLAY_NAME,
|
||||
RINKEBY_DISPLAY_NAME,
|
||||
KOVAN_DISPLAY_NAME,
|
||||
MAINNET_DISPLAY_NAME,
|
||||
MAINNET_RPC_URL,
|
||||
ROPSTEN_RPC_URL,
|
||||
KOVAN_RPC_URL,
|
||||
RINKEBY_RPC_URL,
|
||||
LOCALHOST_RPC_URL,
|
||||
MAINNET_RPC_URL_BETA,
|
||||
ROPSTEN_RPC_URL_BETA,
|
||||
KOVAN_RPC_URL_BETA,
|
||||
RINKEBY_RPC_URL_BETA,
|
||||
OLD_UI_NETWORK_TYPE,
|
||||
BETA_UI_NETWORK_TYPE,
|
||||
} = require('./enums')
|
||||
|
||||
const networkToNameMap = {
|
||||
[ROPSTEN]: ROPSTEN_DISPLAY_NAME,
|
||||
[RINKEBY]: RINKEBY_DISPLAY_NAME,
|
||||
[KOVAN]: KOVAN_DISPLAY_NAME,
|
||||
[MAINNET]: MAINNET_DISPLAY_NAME,
|
||||
[ROPSTEN_CODE]: ROPSTEN_DISPLAY_NAME,
|
||||
[RINKEYBY_CODE]: RINKEBY_DISPLAY_NAME,
|
||||
[KOVAN_CODE]: KOVAN_DISPLAY_NAME,
|
||||
}
|
||||
|
||||
const networkEndpointsMap = {
|
||||
[OLD_UI_NETWORK_TYPE]: {
|
||||
[LOCALHOST]: LOCALHOST_RPC_URL,
|
||||
[MAINNET]: MAINNET_RPC_URL,
|
||||
[ROPSTEN]: ROPSTEN_RPC_URL,
|
||||
[KOVAN]: KOVAN_RPC_URL,
|
||||
[RINKEBY]: RINKEBY_RPC_URL,
|
||||
},
|
||||
[BETA_UI_NETWORK_TYPE]: {
|
||||
[LOCALHOST]: LOCALHOST_RPC_URL,
|
||||
[MAINNET]: MAINNET_RPC_URL_BETA,
|
||||
[ROPSTEN]: ROPSTEN_RPC_URL_BETA,
|
||||
[KOVAN]: KOVAN_RPC_URL_BETA,
|
||||
[RINKEBY]: RINKEBY_RPC_URL_BETA,
|
||||
},
|
||||
}
|
||||
|
||||
const getNetworkDisplayName = key => networkToNameMap[key]
|
||||
|
||||
const getNetworkEndpoints = (networkType = OLD_UI_NETWORK_TYPE) => {
|
||||
return {
|
||||
...networkEndpointsMap[networkType],
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getNetworkDisplayName,
|
||||
getNetworkEndpoints,
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
// test and development environment variables
|
||||
const env = process.env.METAMASK_ENV
|
||||
const METAMASK_DEBUG = process.env.METAMASK_DEBUG
|
||||
const { DEFAULT_NETWORK, MAINNET } = require('./controllers/network/enums')
|
||||
|
||||
/**
|
||||
* @typedef {Object} FirstTimeState
|
||||
@ -15,7 +16,7 @@ const initialState = {
|
||||
config: {},
|
||||
NetworkController: {
|
||||
provider: {
|
||||
type: (METAMASK_DEBUG || env === 'test') ? 'rinkeby' : 'mainnet',
|
||||
type: (METAMASK_DEBUG || env === 'test') ? DEFAULT_NETWORK : MAINNET,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
const ethUtil = require('ethereumjs-util')
|
||||
const normalize = require('eth-sig-util').normalize
|
||||
const MetamaskConfig = require('../config.js')
|
||||
|
||||
|
||||
const MAINNET_RPC = MetamaskConfig.network.mainnet
|
||||
const ROPSTEN_RPC = MetamaskConfig.network.ropsten
|
||||
const KOVAN_RPC = MetamaskConfig.network.kovan
|
||||
const RINKEBY_RPC = MetamaskConfig.network.rinkeby
|
||||
const {
|
||||
MAINNET_RPC_URL,
|
||||
ROPSTEN_RPC_URL,
|
||||
KOVAN_RPC_URL,
|
||||
RINKEBY_RPC_URL,
|
||||
} = require('../controllers/network/enums')
|
||||
|
||||
/* The config-manager is a convenience object
|
||||
* wrapping a pojo-migrator.
|
||||
@ -174,19 +173,19 @@ ConfigManager.prototype.getCurrentRpcAddress = function () {
|
||||
switch (provider.type) {
|
||||
|
||||
case 'mainnet':
|
||||
return MAINNET_RPC
|
||||
return MAINNET_RPC_URL
|
||||
|
||||
case 'ropsten':
|
||||
return ROPSTEN_RPC
|
||||
return ROPSTEN_RPC_URL
|
||||
|
||||
case 'kovan':
|
||||
return KOVAN_RPC
|
||||
return KOVAN_RPC_URL
|
||||
|
||||
case 'rinkeby':
|
||||
return RINKEBY_RPC
|
||||
return RINKEBY_RPC_URL
|
||||
|
||||
default:
|
||||
return provider && provider.rpcTarget ? provider.rpcTarget : RINKEBY_RPC
|
||||
return provider && provider.rpcTarget ? provider.rpcTarget : RINKEBY_RPC_URL
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ const HDCreateVaultComplete = require('./keychains/hd/create-vault-complete')
|
||||
const HDRestoreVaultScreen = require('./keychains/hd/restore-vault')
|
||||
const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation')
|
||||
const AccountDropdowns = require('./components/account-dropdowns').AccountDropdowns
|
||||
const { BETA_UI_NETWORK_TYPE } = require('../../app/scripts/config').enums
|
||||
const { BETA_UI_NETWORK_TYPE } = require('../../app/scripts/controllers/network/enums')
|
||||
|
||||
module.exports = connect(mapStateToProps)(App)
|
||||
|
||||
|
@ -8,7 +8,7 @@ const ShapeshiftForm = require('./shapeshift-form')
|
||||
const Loading = require('./loading')
|
||||
const AccountPanel = require('./account-panel')
|
||||
const RadioList = require('./custom-radio-list')
|
||||
const networkNames = require('../../../app/scripts/config.js').networkNames
|
||||
const { getNetworkDisplayName } = require('../../../app/scripts/controllers/network/util')
|
||||
|
||||
module.exports = connect(mapStateToProps)(BuyButtonSubview)
|
||||
|
||||
@ -142,7 +142,7 @@ BuyButtonSubview.prototype.primarySubview = function () {
|
||||
case '3':
|
||||
case '4':
|
||||
case '42':
|
||||
const networkName = networkNames[network]
|
||||
const networkName = getNetworkDisplayName(network)
|
||||
const label = `${networkName} Test Faucet`
|
||||
return (
|
||||
h('div.flex-column', {
|
||||
|
@ -1,6 +1,10 @@
|
||||
const assert = require('assert')
|
||||
const nock = require('nock')
|
||||
const NetworkController = require('../../app/scripts/controllers/network')
|
||||
const {
|
||||
getNetworkDisplayName,
|
||||
getNetworkEndpoints,
|
||||
} = require('../../app/scripts/controllers/network/util')
|
||||
|
||||
const { createTestProviderTools } = require('../stub/provider')
|
||||
const providerResultStub = {}
|
||||
@ -79,4 +83,40 @@ describe('# Network Controller', function () {
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('# Network utils', () => {
|
||||
it('getNetworkDisplayName should return the correct network name', () => {
|
||||
const tests = [
|
||||
{
|
||||
input: 3,
|
||||
expected: 'Ropsten',
|
||||
}, {
|
||||
input: 4,
|
||||
expected: 'Rinkeby',
|
||||
}, {
|
||||
input: 42,
|
||||
expected: 'Kovan',
|
||||
}, {
|
||||
input: 'ropsten',
|
||||
expected: 'Ropsten',
|
||||
}, {
|
||||
input: 'rinkeby',
|
||||
expected: 'Rinkeby',
|
||||
}, {
|
||||
input: 'kovan',
|
||||
expected: 'Kovan',
|
||||
}, {
|
||||
input: 'mainnet',
|
||||
expected: 'Main Ethereum Network',
|
||||
},
|
||||
]
|
||||
|
||||
tests.forEach(({ input, expected }) => assert.equal(getNetworkDisplayName(input), expected))
|
||||
})
|
||||
|
||||
it('getNetworkEndpoints should return the correct endpoints', () => {
|
||||
assert.equal(getNetworkEndpoints('networkBeta').ropsten, 'https://ropsten.infura.io/metamask2')
|
||||
assert.equal(getNetworkEndpoints('network').rinkeby, 'https://rinkeby.infura.io/metamask')
|
||||
})
|
||||
})
|
||||
|
@ -9,7 +9,7 @@ const ShapeshiftForm = require('./shapeshift-form')
|
||||
const Loading = require('./loading')
|
||||
const AccountPanel = require('./account-panel')
|
||||
const RadioList = require('./custom-radio-list')
|
||||
const networkNames = require('../../../app/scripts/config.js').networkNames
|
||||
const { getNetworkDisplayName } = require('../../../app/scripts/controllers/network/util')
|
||||
|
||||
BuyButtonSubview.contextTypes = {
|
||||
t: PropTypes.func,
|
||||
@ -148,7 +148,7 @@ BuyButtonSubview.prototype.primarySubview = function () {
|
||||
case '3':
|
||||
case '4':
|
||||
case '42':
|
||||
const networkName = networkNames[network]
|
||||
const networkName = getNetworkDisplayName(network)
|
||||
const label = `${networkName} ${this.context.t('testFaucet')}`
|
||||
return (
|
||||
h('div.flex-column', {
|
||||
|
@ -4,7 +4,7 @@ const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const networkNames = require('../../../../app/scripts/config.js').networkNames
|
||||
const { getNetworkDisplayName } = require('../../../../app/scripts/controllers/network/util')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
@ -52,7 +52,7 @@ BuyOptions.prototype.renderModalContentOption = function (title, header, onClick
|
||||
BuyOptions.prototype.render = function () {
|
||||
const { network, toCoinbase, address, toFaucet } = this.props
|
||||
const isTestNetwork = ['3', '4', '42'].find(n => n === network)
|
||||
const networkName = networkNames[network]
|
||||
const networkName = getNetworkDisplayName(network)
|
||||
|
||||
return h('div', {}, [
|
||||
h('div.buy-modal-content.transfers-subview', {
|
||||
|
@ -4,7 +4,7 @@ const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const networkNames = require('../../../../app/scripts/config.js').networkNames
|
||||
const { getNetworkDisplayName } = require('../../../../app/scripts/controllers/network/util')
|
||||
const ShapeshiftForm = require('../shapeshift-form')
|
||||
|
||||
let DIRECT_DEPOSIT_ROW_TITLE
|
||||
@ -122,7 +122,7 @@ DepositEtherModal.prototype.render = function () {
|
||||
const { buyingWithShapeshift } = this.state
|
||||
|
||||
const isTestNetwork = ['3', '4', '42'].find(n => n === network)
|
||||
const networkName = networkNames[network]
|
||||
const networkName = getNetworkDisplayName(network)
|
||||
|
||||
return h('div.page-container.page-container--full-width.page-container--full-height', {}, [
|
||||
|
||||
|
@ -12,7 +12,7 @@ const SimpleDropdown = require('../../dropdowns/simple-dropdown')
|
||||
const ToggleButton = require('react-toggle-button')
|
||||
const { REVEAL_SEED_ROUTE } = require('../../../routes')
|
||||
const locales = require('../../../../../app/_locales/index.json')
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../../../../app/scripts/config').enums
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../../../../app/scripts/controllers/network/enums')
|
||||
|
||||
const getInfuraCurrencyOptions = () => {
|
||||
const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => {
|
||||
|
@ -16,7 +16,7 @@ const { getEnvironmentType } = require('../../../../app/scripts/lib/util')
|
||||
const getCaretCoordinates = require('textarea-caret')
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
const Mascot = require('../mascot')
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../../../app/scripts/config').enums
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../../../app/scripts/controllers/network/enums')
|
||||
const { DEFAULT_ROUTE, RESTORE_VAULT_ROUTE } = require('../../routes')
|
||||
|
||||
class UnlockScreen extends Component {
|
||||
|
@ -10,7 +10,7 @@ const getCaretCoordinates = require('textarea-caret')
|
||||
const { RESTORE_VAULT_ROUTE, DEFAULT_ROUTE } = require('../routes')
|
||||
const { getEnvironmentType } = require('../../../app/scripts/lib/util')
|
||||
const { ENVIRONMENT_TYPE_POPUP } = require('../../../app/scripts/lib/enums')
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../../app/scripts/config').enums
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../../app/scripts/controllers/network/enums')
|
||||
|
||||
class InitializeMenuScreen extends Component {
|
||||
constructor (props) {
|
||||
|
@ -3,7 +3,7 @@ const actions = require('../actions')
|
||||
const MetamascaraPlatform = require('../../../app/scripts/platforms/window')
|
||||
const { getEnvironmentType } = require('../../../app/scripts/lib/util')
|
||||
const { ENVIRONMENT_TYPE_POPUP } = require('../../../app/scripts/lib/enums')
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../../app/scripts/config').enums
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../../app/scripts/controllers/network/enums')
|
||||
|
||||
module.exports = reduceMetamask
|
||||
|
||||
|
@ -7,7 +7,7 @@ const App = require('./app')
|
||||
const OldApp = require('../../old-ui/app/app')
|
||||
const { autoAddToBetaUI } = require('./selectors')
|
||||
const { setFeatureFlag, setNetworkEndpoints } = require('./actions')
|
||||
const { BETA_UI_NETWORK_TYPE } = require('../../app/scripts/config').enums
|
||||
const { BETA_UI_NETWORK_TYPE } = require('../../app/scripts/controllers/network/enums')
|
||||
const I18nProvider = require('./i18n-provider')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
|
@ -6,7 +6,7 @@ const connect = require('react-redux').connect
|
||||
const actions = require('./actions')
|
||||
const getCaretCoordinates = require('textarea-caret')
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../app/scripts/config').enums
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../app/scripts/controllers/network/enums')
|
||||
const { getEnvironmentType } = require('../../app/scripts/lib/util')
|
||||
const { ENVIRONMENT_TYPE_POPUP } = require('../../app/scripts/lib/enums')
|
||||
|
||||
|
@ -5,7 +5,11 @@ const actions = require('./app/actions')
|
||||
const configureStore = require('./app/store')
|
||||
const txHelper = require('./lib/tx-helper')
|
||||
const { fetchLocale } = require('./i18n-helper')
|
||||
const { OLD_UI_NETWORK_TYPE, BETA_UI_NETWORK_TYPE } = require('../app/scripts/config').enums
|
||||
const {
|
||||
OLD_UI_NETWORK_TYPE,
|
||||
BETA_UI_NETWORK_TYPE,
|
||||
} = require('../app/scripts/controllers/network/enums')
|
||||
|
||||
const log = require('loglevel')
|
||||
|
||||
module.exports = launchMetamaskUi
|
||||
|
Loading…
Reference in New Issue
Block a user