1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix import/order issues (#9239)

See [`import/order`](https://eslint.org/docs/rules/import/order) for more information.

This change enables `import/order` and fixes the issues raised by the rule.
This commit is contained in:
Whymarrh Whitby 2020-08-18 16:48:25 -02:30 committed by GitHub
parent b7259e5d6a
commit c1e3c229bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
295 changed files with 415 additions and 411 deletions

View File

@ -50,6 +50,7 @@ module.exports = {
'implicit-arrow-linebreak': 'error', 'implicit-arrow-linebreak': 'error',
'import/extensions': ['error', 'never', { 'json': 'always' }], 'import/extensions': ['error', 'never', { 'json': 'always' }],
'import/no-extraneous-dependencies': 'error', 'import/no-extraneous-dependencies': 'error',
'import/order': 'error',
'import/unambiguous': 'error', 'import/unambiguous': 'error',
'max-statements-per-line': ['error', { 'max': 1 }], 'max-statements-per-line': ['error', { 'max': 1 }],
'no-case-declarations': 'error', 'no-case-declarations': 'error',

View File

@ -1,11 +1,11 @@
/** /**
* @file The entry point for the web extension singleton process. * @file The entry point for the web extension singleton process.
*/ */
// these need to run before anything else // these need to run before anything else
/* eslint-disable import/order */
import './lib/freezeGlobals' import './lib/freezeGlobals'
import setupFetchDebugging from './lib/setupFetchDebugging' import setupFetchDebugging from './lib/setupFetchDebugging'
/* eslint-enable import/order */
setupFetchDebugging() setupFetchDebugging()
@ -17,14 +17,14 @@ import pump from 'pump'
import debounce from 'debounce-stream' import debounce from 'debounce-stream'
import log from 'loglevel' import log from 'loglevel'
import extension from 'extensionizer' import extension from 'extensionizer'
import ReadOnlyNetworkStore from './lib/network-store'
import LocalStore from './lib/local-store'
import storeTransform from 'obs-store/lib/transform' import storeTransform from 'obs-store/lib/transform'
import asStream from 'obs-store/lib/asStream' import asStream from 'obs-store/lib/asStream'
import ExtensionPlatform from './platforms/extension'
import Migrator from './lib/migrator'
import migrations from './migrations'
import PortStream from 'extension-port-stream' import PortStream from 'extension-port-stream'
import migrations from './migrations'
import Migrator from './lib/migrator'
import ExtensionPlatform from './platforms/extension'
import LocalStore from './lib/local-store'
import ReadOnlyNetworkStore from './lib/network-store'
import createStreamSink from './lib/createStreamSink' import createStreamSink from './lib/createStreamSink'
import NotificationManager from './lib/notification-manager' import NotificationManager from './lib/notification-manager'
import MetamaskController from './metamask-controller' import MetamaskController from './metamask-controller'

View File

@ -1,5 +1,5 @@
import pump from 'pump'
import querystring from 'querystring' import querystring from 'querystring'
import pump from 'pump'
import LocalMessageDuplexStream from 'post-message-stream' import LocalMessageDuplexStream from 'post-message-stream'
import ObjectMultiplex from 'obj-multiplex' import ObjectMultiplex from 'obj-multiplex'
import extension from 'extensionizer' import extension from 'extensionizer'

View File

@ -1,5 +1,5 @@
import ObservableStore from 'obs-store'
import EventEmitter from 'events' import EventEmitter from 'events'
import ObservableStore from 'obs-store'
export default class AppStateController extends EventEmitter { export default class AppStateController extends EventEmitter {
/** /**

View File

@ -1,11 +1,11 @@
import Web3 from 'web3' import Web3 from 'web3'
import contracts from 'eth-contract-metadata' import contracts from 'eth-contract-metadata'
import { warn } from 'loglevel' import { warn } from 'loglevel'
import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi'
import { MAINNET } from './network/enums' import { MAINNET } from './network/enums'
// By default, poll every 3 minutes // By default, poll every 3 minutes
const DEFAULT_INTERVAL = 180 * 1000 const DEFAULT_INTERVAL = 180 * 1000
import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi'
const SINGLE_CALL_BALANCES_ADDRESS = '0xb1f8e55c7f64d203c1400b9d8555d050f94adf39' const SINGLE_CALL_BALANCES_ADDRESS = '0xb1f8e55c7f64d203c1400b9d8555d050f94adf39'
/** /**
* A controller that polls for token exchange * A controller that polls for token exchange

View File

@ -1,6 +1,6 @@
import punycode from 'punycode'
import ethUtil from 'ethereumjs-util' import ethUtil from 'ethereumjs-util'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import punycode from 'punycode'
import log from 'loglevel' import log from 'loglevel'
import Ens from './ens' import Ens from './ens'

View File

@ -1,5 +1,5 @@
import { formatTxMetaForRpcResult } from '../util'
import createAsyncMiddleware from 'json-rpc-engine/src/createAsyncMiddleware' import createAsyncMiddleware from 'json-rpc-engine/src/createAsyncMiddleware'
import { formatTxMetaForRpcResult } from '../util'
export function createPendingNonceMiddleware ({ getPendingNonce }) { export function createPendingNonceMiddleware ({ getPendingNonce }) {
return createAsyncMiddleware(async (req, res, next) => { return createAsyncMiddleware(async (req, res, next) => {

View File

@ -6,11 +6,11 @@ import EthQuery from 'eth-query'
import JsonRpcEngine from 'json-rpc-engine' import JsonRpcEngine from 'json-rpc-engine'
import providerFromEngine from 'eth-json-rpc-middleware/providerFromEngine' import providerFromEngine from 'eth-json-rpc-middleware/providerFromEngine'
import log from 'loglevel' import log from 'loglevel'
import { createSwappableProxy, createEventEmitterProxy } from 'swappable-obj-proxy'
import createMetamaskMiddleware from './createMetamaskMiddleware' import createMetamaskMiddleware from './createMetamaskMiddleware'
import createInfuraClient from './createInfuraClient' import createInfuraClient from './createInfuraClient'
import createJsonRpcClient from './createJsonRpcClient' import createJsonRpcClient from './createJsonRpcClient'
import createLocalhostClient from './createLocalhostClient' import createLocalhostClient from './createLocalhostClient'
import { createSwappableProxy, createEventEmitterProxy } from 'swappable-obj-proxy'
const networks = { networkList: {} } const networks = { networkList: {} }

View File

@ -1,7 +1,7 @@
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import { addInternalMethodPrefix } from './permissions'
import { normalize as normalizeAddress } from 'eth-sig-util' import { normalize as normalizeAddress } from 'eth-sig-util'
import { isValidAddress, sha3, bufferToHex } from 'ethereumjs-util' import { isValidAddress, sha3, bufferToHex } from 'ethereumjs-util'
import { addInternalMethodPrefix } from './permissions'
export default class PreferencesController { export default class PreferencesController {

View File

@ -1,16 +1,18 @@
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
/* eslint-disable import/order */
const Box = process.env.IN_TEST const Box = process.env.IN_TEST
? require('../../../development/mock-3box') ? require('../../../development/mock-3box')
: require('3box') : require('3box')
/* eslint-enable import/order */
import log from 'loglevel' import log from 'loglevel'
import migrations from '../migrations'
import Migrator from '../lib/migrator'
import JsonRpcEngine from 'json-rpc-engine' import JsonRpcEngine from 'json-rpc-engine'
import providerFromEngine from 'eth-json-rpc-middleware/providerFromEngine' import providerFromEngine from 'eth-json-rpc-middleware/providerFromEngine'
import createMetamaskMiddleware from './network/createMetamaskMiddleware' import Migrator from '../lib/migrator'
import migrations from '../migrations'
import createOriginMiddleware from '../lib/createOriginMiddleware' import createOriginMiddleware from '../lib/createOriginMiddleware'
import createMetamaskMiddleware from './network/createMetamaskMiddleware'
const SYNC_TIMEOUT = 60 * 1000 // one minute const SYNC_TIMEOUT = 60 * 1000 // one minute

View File

@ -9,6 +9,8 @@ import abiDecoder from 'abi-decoder'
abiDecoder.addABI(abi) abiDecoder.addABI(abi)
import NonceTracker from 'nonce-tracker'
import log from 'loglevel'
import { import {
TOKEN_METHOD_APPROVE, TOKEN_METHOD_APPROVE,
TOKEN_METHOD_TRANSFER, TOKEN_METHOD_TRANSFER,
@ -18,13 +20,13 @@ import {
CONTRACT_INTERACTION_KEY, CONTRACT_INTERACTION_KEY,
} from '../../../../ui/app/helpers/constants/transactions' } from '../../../../ui/app/helpers/constants/transactions'
import cleanErrorStack from '../../lib/cleanErrorStack'
import { hexToBn, bnToHex, BnMultiplyByFraction } from '../../lib/util'
import { TRANSACTION_NO_CONTRACT_ERROR_KEY } from '../../../../ui/app/helpers/constants/error-keys'
import TransactionStateManager from './tx-state-manager' import TransactionStateManager from './tx-state-manager'
import TxGasUtil from './tx-gas-utils' import TxGasUtil from './tx-gas-utils'
import PendingTransactionTracker from './pending-tx-tracker' import PendingTransactionTracker from './pending-tx-tracker'
import NonceTracker from 'nonce-tracker'
import * as txUtils from './lib/util' import * as txUtils from './lib/util'
import cleanErrorStack from '../../lib/cleanErrorStack'
import log from 'loglevel'
import { import {
TRANSACTION_TYPE_CANCEL, TRANSACTION_TYPE_CANCEL,
@ -33,8 +35,6 @@ import {
TRANSACTION_STATUS_APPROVED, TRANSACTION_STATUS_APPROVED,
} from './enums' } from './enums'
import { hexToBn, bnToHex, BnMultiplyByFraction } from '../../lib/util'
import { TRANSACTION_NO_CONTRACT_ERROR_KEY } from '../../../../ui/app/helpers/constants/error-keys'
const SIMPLE_GAS_COST = '0x5208' // Hex for 21000, cost of a simple send. const SIMPLE_GAS_COST = '0x5208' // Hex for 21000, cost of a simple send.
const MAX_MEMSTORE_TX_LIST_SIZE = 100 // Number of transactions (by unique nonces) to keep in memory const MAX_MEMSTORE_TX_LIST_SIZE = 100 // Number of transactions (by unique nonces) to keep in memory

View File

@ -1,6 +1,6 @@
import EthQuery from 'ethjs-query' import EthQuery from 'ethjs-query'
import { hexToBn, BnMultiplyByFraction, bnToHex } from '../../lib/util'
import log from 'loglevel' import log from 'loglevel'
import { hexToBn, BnMultiplyByFraction, bnToHex } from '../../lib/util'
/** /**
* Result of gas analysis, including either a gas estimate for a successful analysis, or * Result of gas analysis, including either a gas estimate for a successful analysis, or

View File

@ -1,8 +1,8 @@
import EventEmitter from 'safe-event-emitter' import EventEmitter from 'safe-event-emitter'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import log from 'loglevel' import log from 'loglevel'
import { generateHistoryEntry, replayHistory, snapshotFromTxMeta } from './lib/tx-state-history-helpers'
import createId from '../../lib/random-id' import createId from '../../lib/random-id'
import { generateHistoryEntry, replayHistory, snapshotFromTxMeta } from './lib/tx-state-history-helpers'
import { getFinalStates, normalizeTxParams } from './lib/util' import { getFinalStates, normalizeTxParams } from './lib/util'
/** /**
TransactionStateManager is responsible for the state of a transaction and TransactionStateManager is responsible for the state of a transaction and

View File

@ -14,7 +14,6 @@ import log from 'loglevel'
import pify from 'pify' import pify from 'pify'
import Web3 from 'web3' import Web3 from 'web3'
import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi' import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi'
import { bnToHex } from './util'
import { MAINNET_NETWORK_ID, RINKEBY_NETWORK_ID, ROPSTEN_NETWORK_ID, KOVAN_NETWORK_ID } from '../controllers/network/enums' import { MAINNET_NETWORK_ID, RINKEBY_NETWORK_ID, ROPSTEN_NETWORK_ID, KOVAN_NETWORK_ID } from '../controllers/network/enums'
import { import {
@ -23,6 +22,7 @@ import {
SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN, SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN,
SINGLE_CALL_BALANCES_ADDRESS_KOVAN, SINGLE_CALL_BALANCES_ADDRESS_KOVAN,
} from '../controllers/network/contract-addresses' } from '../controllers/network/contract-addresses'
import { bnToHex } from './util'
export default class AccountTracker { export default class AccountTracker {

View File

@ -2,11 +2,11 @@ import EventEmitter from 'events'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import ethUtil from 'ethereumjs-util' import ethUtil from 'ethereumjs-util'
import { ethErrors } from 'eth-json-rpc-errors' import { ethErrors } from 'eth-json-rpc-errors'
import log from 'loglevel'
import createId from './random-id' import createId from './random-id'
import { MESSAGE_TYPE } from './enums' import { MESSAGE_TYPE } from './enums'
const hexRe = /^[0-9A-Fa-f]+$/ug const hexRe = /^[0-9A-Fa-f]+$/ug
import log from 'loglevel'
/** /**
* Represents, and contains data about, an 'eth_decrypt' type decryption request. These are created when a * Represents, and contains data about, an 'eth_decrypt' type decryption request. These are created when a

View File

@ -1,8 +1,8 @@
import EventEmitter from 'events' import EventEmitter from 'events'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import { ethErrors } from 'eth-json-rpc-errors' import { ethErrors } from 'eth-json-rpc-errors'
import createId from './random-id'
import log from 'loglevel' import log from 'loglevel'
import createId from './random-id'
import { MESSAGE_TYPE } from './enums' import { MESSAGE_TYPE } from './enums'
/** /**

View File

@ -1,9 +1,9 @@
import namehash from 'eth-ens-namehash' import namehash from 'eth-ens-namehash'
import Eth from 'ethjs-query' import Eth from 'ethjs-query'
import EthContract from 'ethjs-contract' import EthContract from 'ethjs-contract'
import contentHash from 'content-hash'
import registryAbi from './contracts/registry' import registryAbi from './contracts/registry'
import resolverAbi from './contracts/resolver' import resolverAbi from './contracts/resolver'
import contentHash from 'content-hash'
export default async function resolveEnsToIpfsContentId ({ provider, name }) { export default async function resolveEnsToIpfsContentId ({ provider, name }) {
const eth = new Eth(provider) const eth = new Eth(provider)

View File

@ -2,11 +2,11 @@ import EventEmitter from 'events'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import ethUtil from 'ethereumjs-util' import ethUtil from 'ethereumjs-util'
import { ethErrors } from 'eth-json-rpc-errors' import { ethErrors } from 'eth-json-rpc-errors'
import log from 'loglevel'
import createId from './random-id' import createId from './random-id'
import { MESSAGE_TYPE } from './enums' import { MESSAGE_TYPE } from './enums'
const hexRe = /^[0-9A-Fa-f]+$/ug const hexRe = /^[0-9A-Fa-f]+$/ug
import log from 'loglevel'
/** /**
* Represents, and contains data about, an 'personal_sign' type signature request. These are created when a * Represents, and contains data about, an 'personal_sign' type signature request. These are created when a

View File

@ -1,12 +1,12 @@
import EventEmitter from 'events' import EventEmitter from 'events'
import ObservableStore from 'obs-store'
import createId from './random-id'
import assert from 'assert' import assert from 'assert'
import ObservableStore from 'obs-store'
import { ethErrors } from 'eth-json-rpc-errors' import { ethErrors } from 'eth-json-rpc-errors'
import sigUtil from 'eth-sig-util' import sigUtil from 'eth-sig-util'
import { isValidAddress } from 'ethereumjs-util' import { isValidAddress } from 'ethereumjs-util'
import log from 'loglevel' import log from 'loglevel'
import jsonschema from 'jsonschema' import jsonschema from 'jsonschema'
import createId from './random-id'
import { MESSAGE_TYPE } from './enums' import { MESSAGE_TYPE } from './enums'
/** /**

View File

@ -1,6 +1,6 @@
import assert from 'assert'
import extension from 'extensionizer' import extension from 'extensionizer'
import ethUtil from 'ethereumjs-util' import ethUtil from 'ethereumjs-util'
import assert from 'assert'
import BN from 'bn.js' import BN from 'bn.js'
import { memoize } from 'lodash' import { memoize } from 'lodash'

View File

@ -10,22 +10,35 @@ import pump from 'pump'
import Dnode from 'dnode' import Dnode from 'dnode'
import extension from 'extensionizer' import extension from 'extensionizer'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import ComposableObservableStore from './lib/ComposableObservableStore'
import asStream from 'obs-store/lib/asStream' import asStream from 'obs-store/lib/asStream'
import AccountTracker from './lib/account-tracker'
import RpcEngine from 'json-rpc-engine' import RpcEngine from 'json-rpc-engine'
import { debounce } from 'lodash' import { debounce } from 'lodash'
import createEngineStream from 'json-rpc-middleware-stream/engineStream' import createEngineStream from 'json-rpc-middleware-stream/engineStream'
import createFilterMiddleware from 'eth-json-rpc-filters' import createFilterMiddleware from 'eth-json-rpc-filters'
import createSubscriptionManager from 'eth-json-rpc-filters/subscriptionManager' import createSubscriptionManager from 'eth-json-rpc-filters/subscriptionManager'
import providerAsMiddleware from 'eth-json-rpc-middleware/providerAsMiddleware'
import KeyringController from 'eth-keyring-controller'
import { Mutex } from 'await-semaphore'
import ethUtil from 'ethereumjs-util'
import log from 'loglevel'
import TrezorKeyring from 'eth-trezor-keyring'
import LedgerBridgeKeyring from '@metamask/eth-ledger-bridge-keyring'
import EthQuery from 'eth-query'
import nanoid from 'nanoid'
import contractMap from 'eth-contract-metadata'
import {
AddressBookController,
CurrencyRateController,
PhishingController,
} from '@metamask/controllers'
import ComposableObservableStore from './lib/ComposableObservableStore'
import AccountTracker from './lib/account-tracker'
import createLoggerMiddleware from './lib/createLoggerMiddleware' import createLoggerMiddleware from './lib/createLoggerMiddleware'
import createMethodMiddleware from './lib/createMethodMiddleware' import createMethodMiddleware from './lib/createMethodMiddleware'
import createOriginMiddleware from './lib/createOriginMiddleware' import createOriginMiddleware from './lib/createOriginMiddleware'
import createTabIdMiddleware from './lib/createTabIdMiddleware' import createTabIdMiddleware from './lib/createTabIdMiddleware'
import createOnboardingMiddleware from './lib/createOnboardingMiddleware' import createOnboardingMiddleware from './lib/createOnboardingMiddleware'
import providerAsMiddleware from 'eth-json-rpc-middleware/providerAsMiddleware'
import { setupMultiplex } from './lib/stream-utils' import { setupMultiplex } from './lib/stream-utils'
import KeyringController from 'eth-keyring-controller'
import EnsController from './controllers/ens' import EnsController from './controllers/ens'
import NetworkController from './controllers/network' import NetworkController from './controllers/network'
import PreferencesController from './controllers/preferences' import PreferencesController from './controllers/preferences'
@ -48,22 +61,8 @@ import getRestrictedMethods from './controllers/permissions/restrictedMethods'
import nodeify from './lib/nodeify' import nodeify from './lib/nodeify'
import accountImporter from './account-import-strategies' import accountImporter from './account-import-strategies'
import selectChainId from './lib/select-chain-id' import selectChainId from './lib/select-chain-id'
import { Mutex } from 'await-semaphore'
import ethUtil from 'ethereumjs-util'
import seedPhraseVerifier from './lib/seed-phrase-verifier' import seedPhraseVerifier from './lib/seed-phrase-verifier'
import log from 'loglevel'
import TrezorKeyring from 'eth-trezor-keyring'
import LedgerBridgeKeyring from '@metamask/eth-ledger-bridge-keyring'
import EthQuery from 'eth-query'
import nanoid from 'nanoid'
import contractMap from 'eth-contract-metadata'
import {
AddressBookController,
CurrencyRateController,
PhishingController,
} from '@metamask/controllers'
import backgroundMetaMetricsEvent from './lib/background-metametrics' import backgroundMetaMetricsEvent from './lib/background-metametrics'

View File

@ -1,6 +1,6 @@
import querystring from 'querystring' import querystring from 'querystring'
import dnode from 'dnode'
import { EventEmitter } from 'events' import { EventEmitter } from 'events'
import dnode from 'dnode'
import PortStream from 'extension-port-stream' import PortStream from 'extension-port-stream'
import extension from 'extensionizer' import extension from 'extensionizer'
import { setupMultiplex } from './lib/stream-utils' import { setupMultiplex } from './lib/stream-utils'

View File

@ -6,26 +6,26 @@ import './lib/freezeGlobals'
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch' import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'
import '@formatjs/intl-relativetimeformat/polyfill' import '@formatjs/intl-relativetimeformat/polyfill'
import { EventEmitter } from 'events'
import PortStream from 'extension-port-stream' import PortStream from 'extension-port-stream'
import { getEnvironmentType } from './lib/util'
import extension from 'extensionizer'
import Dnode from 'dnode'
import Eth from 'ethjs'
import EthQuery from 'eth-query'
import StreamProvider from 'web3-stream-provider'
import log from 'loglevel'
import launchMetaMaskUi from '../../ui'
import { setupMultiplex } from './lib/stream-utils'
import setupSentry from './lib/setupSentry'
import ExtensionPlatform from './platforms/extension'
import { import {
ENVIRONMENT_TYPE_FULLSCREEN, ENVIRONMENT_TYPE_FULLSCREEN,
ENVIRONMENT_TYPE_POPUP, ENVIRONMENT_TYPE_POPUP,
} from './lib/enums' } from './lib/enums'
import { getEnvironmentType } from './lib/util'
import extension from 'extensionizer'
import ExtensionPlatform from './platforms/extension'
import setupSentry from './lib/setupSentry'
import { EventEmitter } from 'events'
import Dnode from 'dnode'
import Eth from 'ethjs'
import EthQuery from 'eth-query'
import launchMetaMaskUi from '../../ui'
import StreamProvider from 'web3-stream-provider'
import { setupMultiplex } from './lib/stream-utils'
import log from 'loglevel'
start().catch(log.error) start().catch(log.error)

View File

@ -1,7 +1,7 @@
const { promises: fs } = require('fs')
const gulp = require('gulp') const gulp = require('gulp')
const gulpZip = require('gulp-zip') const gulpZip = require('gulp-zip')
const del = require('del') const del = require('del')
const { promises: fs } = require('fs')
const pify = require('pify') const pify = require('pify')
const pump = pify(require('pump')) const pump = pify(require('pump'))
const baseManifest = require('../../app/manifest/_base.json') const baseManifest = require('../../app/manifest/_base.json')

View File

@ -17,8 +17,8 @@ const { makeStringTransform } = require('browserify-transform-tools')
const conf = require('rc')('metamask', {}) const conf = require('rc')('metamask', {})
const { createTask, composeParallel, composeSeries, runInChildProcess } = require('./task')
const packageJSON = require('../../package.json') const packageJSON = require('../../package.json')
const { createTask, composeParallel, composeSeries, runInChildProcess } = require('./task')
module.exports = createScriptTasks module.exports = createScriptTasks

View File

@ -1,5 +1,5 @@
const fs = require('fs-extra')
const path = require('path') const path = require('path')
const fs = require('fs-extra')
const watch = require('gulp-watch') const watch = require('gulp-watch')
const glob = require('fast-glob') const glob = require('fast-glob')

View File

@ -1,6 +1,8 @@
#!/usr/bin/env node #!/usr/bin/env node
const childProcess = require('child_process')
const pify = require('pify') const pify = require('pify')
const exec = pify(require('child_process').exec, { multiArgs: true })
const exec = pify(childProcess.exec, { multiArgs: true })
const VERSION = require('../dist/chrome/manifest.json').version // eslint-disable-line import/no-unresolved const VERSION = require('../dist/chrome/manifest.json').version // eslint-disable-line import/no-unresolved
start().catch(console.error) start().catch(console.error)

View File

@ -1,6 +1,6 @@
const fs = require('fs') const fs = require('fs')
const { SourceMapConsumer } = require('source-map')
const path = require('path') const path = require('path')
const { SourceMapConsumer } = require('source-map')
const pify = require('pify') const pify = require('pify')
const fsAsync = pify(fs) const fsAsync = pify(fs)

View File

@ -1,6 +1,7 @@
const assert = require('assert') const assert = require('assert')
const { By, until } = require('selenium-webdriver') const { By, until } = require('selenium-webdriver')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const { const {
tinyDelayMs, tinyDelayMs,
regularDelayMs, regularDelayMs,
@ -8,7 +9,6 @@ const {
} = require('./helpers') } = require('./helpers')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const ganacheServer = new Ganache() const ganacheServer = new Ganache()

View File

@ -2,13 +2,13 @@ const assert = require('assert')
const webdriver = require('selenium-webdriver') const webdriver = require('selenium-webdriver')
const { By, until } = webdriver const { By, until } = webdriver
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const { const {
regularDelayMs, regularDelayMs,
largeDelayMs, largeDelayMs,
} = require('./helpers') } = require('./helpers')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const ganacheServer = new Ganache() const ganacheServer = new Ganache()

View File

@ -1,6 +1,6 @@
const { promises: fs } = require('fs') const { promises: fs } = require('fs')
const Koa = require('koa')
const path = require('path') const path = require('path')
const Koa = require('koa')
const CURRENT_STATE_KEY = '__CURRENT__' const CURRENT_STATE_KEY = '__CURRENT__'
const DEFAULT_STATE_KEY = '__DEFAULT__' const DEFAULT_STATE_KEY = '__DEFAULT__'

View File

@ -2,13 +2,13 @@ const assert = require('assert')
const webdriver = require('selenium-webdriver') const webdriver = require('selenium-webdriver')
const { By, Key, until } = webdriver const { By, Key, until } = webdriver
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const { const {
regularDelayMs, regularDelayMs,
largeDelayMs, largeDelayMs,
} = require('./helpers') } = require('./helpers')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const ganacheServer = new Ganache() const ganacheServer = new Ganache()

View File

@ -1,5 +1,5 @@
const ganache = require('ganache-core')
const { promisify } = require('util') const { promisify } = require('util')
const ganache = require('ganache-core')
const defaultOptions = { const defaultOptions = {
blockTime: 2, blockTime: 2,

View File

@ -1,8 +1,8 @@
const path = require('path') const path = require('path')
const createStaticServer = require('../../development/create-static-server')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const FixtureServer = require('./fixture-server') const FixtureServer = require('./fixture-server')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const createStaticServer = require('../../development/create-static-server')
const tinyDelayMs = 200 const tinyDelayMs = 200
const regularDelayMs = tinyDelayMs * 2 const regularDelayMs = tinyDelayMs * 2

View File

@ -2,6 +2,7 @@ const assert = require('assert')
const webdriver = require('selenium-webdriver') const webdriver = require('selenium-webdriver')
const { By, until } = webdriver const { By, until } = webdriver
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const { const {
tinyDelayMs, tinyDelayMs,
regularDelayMs, regularDelayMs,
@ -9,7 +10,6 @@ const {
} = require('./helpers') } = require('./helpers')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const ganacheServer = new Ganache() const ganacheServer = new Ganache()

View File

@ -2,6 +2,7 @@ const assert = require('assert')
const webdriver = require('selenium-webdriver') const webdriver = require('selenium-webdriver')
const { By, until } = webdriver const { By, until } = webdriver
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const { const {
tinyDelayMs, tinyDelayMs,
regularDelayMs, regularDelayMs,
@ -9,7 +10,6 @@ const {
} = require('./helpers') } = require('./helpers')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const ganacheServer = new Ganache() const ganacheServer = new Ganache()

View File

@ -2,6 +2,7 @@ const assert = require('assert')
const webdriver = require('selenium-webdriver') const webdriver = require('selenium-webdriver')
const { By, Key, until } = webdriver const { By, Key, until } = webdriver
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const { const {
tinyDelayMs, tinyDelayMs,
regularDelayMs, regularDelayMs,
@ -9,7 +10,6 @@ const {
} = require('./helpers') } = require('./helpers')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const ganacheServer = new Ganache() const ganacheServer = new Ganache()

View File

@ -2,13 +2,13 @@ const assert = require('assert')
const webdriver = require('selenium-webdriver') const webdriver = require('selenium-webdriver')
const { By, until } = webdriver const { By, until } = webdriver
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const { const {
regularDelayMs, regularDelayMs,
largeDelayMs, largeDelayMs,
} = require('./helpers') } = require('./helpers')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const ganacheServer = new Ganache() const ganacheServer = new Ganache()

View File

@ -2,6 +2,7 @@ const assert = require('assert')
const webdriver = require('selenium-webdriver') const webdriver = require('selenium-webdriver')
const { By, until } = webdriver const { By, until } = webdriver
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const { const {
tinyDelayMs, tinyDelayMs,
regularDelayMs, regularDelayMs,
@ -9,7 +10,6 @@ const {
} = require('./helpers') } = require('./helpers')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const ganacheServer = new Ganache() const ganacheServer = new Ganache()

View File

@ -3,6 +3,7 @@ const webdriver = require('selenium-webdriver')
const getPort = require('get-port') const getPort = require('get-port')
const { By, until } = webdriver const { By, until } = webdriver
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const { const {
tinyDelayMs, tinyDelayMs,
regularDelayMs, regularDelayMs,
@ -10,7 +11,6 @@ const {
} = require('./helpers') } = require('./helpers')
const { buildWebDriver } = require('./webdriver') const { buildWebDriver } = require('./webdriver')
const Ganache = require('./ganache') const Ganache = require('./ganache')
const enLocaleMessages = require('../../app/_locales/en/messages.json')
const ganacheServer = new Ganache() const ganacheServer = new Ganache()

View File

@ -1,6 +1,6 @@
const { promises: fs } = require('fs') const { promises: fs } = require('fs')
const { until, error: webdriverError } = require('selenium-webdriver')
const { strict: assert } = require('assert') const { strict: assert } = require('assert')
const { until, error: webdriverError } = require('selenium-webdriver')
class Driver { class Driver {
/** /**

View File

@ -1,8 +1,8 @@
const { Browser } = require('selenium-webdriver') const { Browser } = require('selenium-webdriver')
const fetchMockResponses = require('../../data/fetch-mocks.json')
const Driver = require('./driver') const Driver = require('./driver')
const ChromeDriver = require('./chrome') const ChromeDriver = require('./chrome')
const FirefoxDriver = require('./firefox') const FirefoxDriver = require('./firefox')
const fetchMockResponses = require('../../data/fetch-mocks.json')
async function buildWebDriver ({ responsive, port } = {}) { async function buildWebDriver ({ responsive, port } = {}) {
const browser = process.env.SELENIUM_BROWSER const browser = process.env.SELENIUM_BROWSER

View File

@ -1,6 +1,6 @@
import assert from 'assert' import assert from 'assert'
import ComposableObservableStore from '../../../app/scripts/lib/ComposableObservableStore'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import ComposableObservableStore from '../../../app/scripts/lib/ComposableObservableStore'
describe('ComposableObservableStore', function () { describe('ComposableObservableStore', function () {
it('should register initial state', function () { it('should register initial state', function () {

View File

@ -4,10 +4,10 @@ import { cloneDeep } from 'lodash'
import nock from 'nock' import nock from 'nock'
import ethUtil from 'ethereumjs-util' import ethUtil from 'ethereumjs-util'
import { obj as createThoughStream } from 'through2' import { obj as createThoughStream } from 'through2'
import firstTimeState from '../../localhostState'
import createTxMeta from '../../../lib/createTxMeta'
import EthQuery from 'eth-query' import EthQuery from 'eth-query'
import proxyquire from 'proxyquire' import proxyquire from 'proxyquire'
import firstTimeState from '../../localhostState'
import createTxMeta from '../../../lib/createTxMeta'
const threeBoxSpies = { const threeBoxSpies = {
init: sinon.stub(), init: sinon.stub(),

View File

@ -1,8 +1,8 @@
import assert from 'assert' import assert from 'assert'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import sinon from 'sinon'
import PreferencesController from '../../../../app/scripts/controllers/preferences' import PreferencesController from '../../../../app/scripts/controllers/preferences'
import { addInternalMethodPrefix } from '../../../../app/scripts/controllers/permissions' import { addInternalMethodPrefix } from '../../../../app/scripts/controllers/permissions'
import sinon from 'sinon'
describe('preferences controller', function () { describe('preferences controller', function () {
let preferencesController let preferencesController

View File

@ -1,7 +1,7 @@
import assert from 'assert' import assert from 'assert'
import sinon from 'sinon' import sinon from 'sinon'
import TokenRatesController from '../../../../app/scripts/controllers/token-rates'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import TokenRatesController from '../../../../app/scripts/controllers/token-rates'
describe('TokenRatesController', function () { describe('TokenRatesController', function () {
it('should listen for preferences store updates', function () { it('should listen for preferences store updates', function () {

View File

@ -1,5 +1,5 @@
import sinon from 'sinon'
import { strict as assert } from 'assert' import { strict as assert } from 'assert'
import sinon from 'sinon'
import BN from 'bn.js' import BN from 'bn.js'
import PendingTransactionTracker from '../../../../../app/scripts/controllers/transactions/pending-tx-tracker' import PendingTransactionTracker from '../../../../../app/scripts/controllers/transactions/pending-tx-tracker'

View File

@ -1,5 +1,5 @@
import getAccountLink from '../../../ui/lib/account-link'
import assert from 'assert' import assert from 'assert'
import getAccountLink from '../../../ui/lib/account-link'
describe('Account link', function () { describe('Account link', function () {
describe('getAccountLink', function () { describe('getAccountLink', function () {

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import configureMockStore from 'redux-mock-store' import configureMockStore from 'redux-mock-store'
import thunk from 'redux-thunk' import thunk from 'redux-thunk'
import sinon from 'sinon' import sinon from 'sinon'

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'
import sinon from 'sinon' import sinon from 'sinon'
import * as utils from '../../../../helpers/utils/util' import * as utils from '../../../../helpers/utils/util'

View File

@ -1,10 +1,10 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import configureMockStore from 'redux-mock-store' import configureMockStore from 'redux-mock-store'
import { Provider } from 'react-redux'
import { mountWithRouter } from '../../../../../../test/lib/render-helpers' import { mountWithRouter } from '../../../../../../test/lib/render-helpers'
import AccountMenu from '../index' import AccountMenu from '../index'
import { Provider } from 'react-redux'
describe('Account Menu', function () { describe('Account Menu', function () {

View File

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import { useHistory } from 'react-router-dom'
import { useMetricEvent } from '../../../hooks/useMetricEvent' import { useMetricEvent } from '../../../hooks/useMetricEvent'
import { useI18nContext } from '../../../hooks/useI18nContext' import { useI18nContext } from '../../../hooks/useI18nContext'
import { useHistory } from 'react-router-dom'
import { ADD_TOKEN_ROUTE } from '../../../helpers/constants/routes' import { ADD_TOKEN_ROUTE } from '../../../helpers/constants/routes'
import Button from '../../ui/button' import Button from '../../ui/button'

View File

@ -1,8 +1,8 @@
import React from 'react' import React from 'react'
import { useSelector } from 'react-redux' import { useSelector } from 'react-redux'
import UnconnectedAccountAlert from './unconnected-account-alert'
import { alertIsOpen as unconnectedAccountAlertIsOpen } from '../../../ducks/alerts/unconnected-account' import { alertIsOpen as unconnectedAccountAlertIsOpen } from '../../../ducks/alerts/unconnected-account'
import UnconnectedAccountAlert from './unconnected-account-alert'
const Alerts = () => { const Alerts = () => {
const _unconnectedAccountAlertIsOpen = useSelector(unconnectedAccountAlertIsOpen) const _unconnectedAccountAlertIsOpen = useSelector(unconnectedAccountAlertIsOpen)

View File

@ -2,8 +2,8 @@ import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom' import { withRouter } from 'react-router-dom'
import { compose } from 'redux' import { compose } from 'redux'
import AppHeader from './app-header.component'
import * as actions from '../../../store/actions' import * as actions from '../../../store/actions'
import AppHeader from './app-header.component'
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
const { appState, metamask } = state const { appState, metamask } = state

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'
import MetaFoxLogo from '../../../ui/metafox-logo' import MetaFoxLogo from '../../../ui/metafox-logo'

View File

@ -1,6 +1,8 @@
import React, { useMemo } from 'react' import React, { useMemo } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import classnames from 'classnames' import classnames from 'classnames'
import { useDispatch } from 'react-redux'
import { useHistory } from 'react-router-dom'
import Identicon from '../../ui/identicon' import Identicon from '../../ui/identicon'
import ListItem from '../../ui/list-item' import ListItem from '../../ui/list-item'
import Tooltip from '../../ui/tooltip' import Tooltip from '../../ui/tooltip'
@ -8,9 +10,7 @@ import InfoIcon from '../../ui/icon/info-icon.component'
import Button from '../../ui/button' import Button from '../../ui/button'
import { useI18nContext } from '../../../hooks/useI18nContext' import { useI18nContext } from '../../../hooks/useI18nContext'
import { useMetricEvent } from '../../../hooks/useMetricEvent' import { useMetricEvent } from '../../../hooks/useMetricEvent'
import { useDispatch } from 'react-redux'
import { updateSendToken } from '../../../store/actions' import { updateSendToken } from '../../../store/actions'
import { useHistory } from 'react-router-dom'
import { SEND_ROUTE } from '../../../helpers/constants/routes' import { SEND_ROUTE } from '../../../helpers/constants/routes'

View File

@ -1,8 +1,8 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'
import ConfirmDetailRow from '../confirm-detail-row.component'
import sinon from 'sinon' import sinon from 'sinon'
import ConfirmDetailRow from '../confirm-detail-row.component'
const propsMethodSpies = { const propsMethodSpies = {
onHeaderClick: sinon.spy(), onHeaderClick: sinon.spy(),

View File

@ -2,9 +2,9 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import classnames from 'classnames' import classnames from 'classnames'
import { Tabs, Tab } from '../../../ui/tabs' import { Tabs, Tab } from '../../../ui/tabs'
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.'
import ErrorMessage from '../../../ui/error-message' import ErrorMessage from '../../../ui/error-message'
import { PageContainerFooter } from '../../../ui/page-container' import { PageContainerFooter } from '../../../ui/page-container'
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.'
export default class ConfirmPageContainerContent extends Component { export default class ConfirmPageContainerContent extends Component {

View File

@ -1,8 +1,8 @@
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import { MenuItem } from '../../ui/menu'
import ConnectedAccountsListItem from './connected-accounts-list-item' import ConnectedAccountsListItem from './connected-accounts-list-item'
import ConnectedAccountsListOptions from './connected-accounts-list-options' import ConnectedAccountsListOptions from './connected-accounts-list-options'
import { MenuItem } from '../../ui/menu'
export default class ConnectedAccountsList extends PureComponent { export default class ConnectedAccountsList extends PureComponent {
static contextTypes = { static contextTypes = {

View File

@ -1,6 +1,5 @@
import { findKey } from 'lodash' import { findKey } from 'lodash'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import ConnectedStatusIndicator from './connected-status-indicator.component'
import { import {
STATUS_CONNECTED, STATUS_CONNECTED,
STATUS_CONNECTED_TO_ANOTHER_ACCOUNT, STATUS_CONNECTED_TO_ANOTHER_ACCOUNT,
@ -11,6 +10,7 @@ import {
getOriginOfCurrentTab, getOriginOfCurrentTab,
getSelectedAddress, getSelectedAddress,
} from '../../../selectors' } from '../../../selectors'
import ConnectedStatusIndicator from './connected-status-indicator.component'
const mapStateToProps = (state) => { const mapStateToProps = (state) => {

View File

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Identicon from '../../../ui/identicon'
import classnames from 'classnames' import classnames from 'classnames'
import Identicon from '../../../ui/identicon'
import { ellipsify } from '../../../../pages/send/send.utils' import { ellipsify } from '../../../../pages/send/send.utils'
function addressesEqual (address1, address2) { function addressesEqual (address1, address2) {

View File

@ -4,9 +4,9 @@ import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom' import { withRouter } from 'react-router-dom'
import { compose } from 'redux' import { compose } from 'redux'
import * as actions from '../../../store/actions' import * as actions from '../../../store/actions'
import { NETWORKS_ROUTE } from '../../../helpers/constants/routes'
import { Dropdown, DropdownMenuItem } from './components/dropdown' import { Dropdown, DropdownMenuItem } from './components/dropdown'
import NetworkDropdownIcon from './components/network-dropdown-icon' import NetworkDropdownIcon from './components/network-dropdown-icon'
import { NETWORKS_ROUTE } from '../../../helpers/constants/routes'
// classes from nodes of the toggle element. // classes from nodes of the toggle element.
const notToggleElementClassnames = [ const notToggleElementClassnames = [

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'
import { DropdownMenuItem } from '../components/dropdown' import { DropdownMenuItem } from '../components/dropdown'

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'
import NetworkDropdownIcon from '../components/network-dropdown-icon' import NetworkDropdownIcon from '../components/network-dropdown-icon'

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import configureMockStore from 'redux-mock-store' import configureMockStore from 'redux-mock-store'
import thunk from 'redux-thunk' import thunk from 'redux-thunk'
import { mountWithRouter } from '../../../../../../test/lib/render-helpers' import { mountWithRouter } from '../../../../../../test/lib/render-helpers'

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import { mount } from 'enzyme' import { mount } from 'enzyme'
import AdvancedTabContent from '../index' import AdvancedTabContent from '../index'

View File

@ -1,7 +1,7 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import shallow from '../../../../../../../lib/shallow-with-context' import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import shallow from '../../../../../../../lib/shallow-with-context'
import AdvancedTabContent from '../advanced-tab-content.component' import AdvancedTabContent from '../advanced-tab-content.component'
import GasPriceChart from '../../../gas-price-chart' import GasPriceChart from '../../../gas-price-chart'

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import shallow from '../../../../../../../lib/shallow-with-context' import shallow from '../../../../../../../lib/shallow-with-context'
import BasicTabContent from '../basic-tab-content.component' import BasicTabContent from '../basic-tab-content.component'
import GasPriceButtonGroup from '../../../gas-price-button-group' import GasPriceButtonGroup from '../../../gas-price-button-group'

View File

@ -1,6 +1,6 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import GasModalPageContainer from './gas-modal-page-container.component'
import { captureException } from '@sentry/browser' import { captureException } from '@sentry/browser'
import { addHexPrefix } from 'ethereumjs-util'
import { import {
hideModal, hideModal,
setGasLimit, setGasLimit,
@ -63,8 +63,8 @@ import {
calcGasTotal, calcGasTotal,
isBalanceSufficient, isBalanceSufficient,
} from '../../../../pages/send/send.utils' } from '../../../../pages/send/send.utils'
import { addHexPrefix } from 'ethereumjs-util'
import { calcMaxAmount } from '../../../../pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils' import { calcMaxAmount } from '../../../../pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils'
import GasModalPageContainer from './gas-modal-page-container.component'
const mapStateToProps = (state, ownProps) => { const mapStateToProps = (state, ownProps) => {
const { currentNetworkTxList, send } = state.metamask const { currentNetworkTxList, send } = state.metamask

View File

@ -1,7 +1,7 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import shallow from '../../../../../../lib/shallow-with-context' import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import shallow from '../../../../../../lib/shallow-with-context'
import GasModalPageContainer from '../gas-modal-page-container.component' import GasModalPageContainer from '../gas-modal-page-container.component'
import timeout from '../../../../../../lib/test-timeout' import timeout from '../../../../../../lib/test-timeout'

View File

@ -1,7 +1,7 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import shallow from '../../../../../../lib/shallow-with-context' import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import shallow from '../../../../../../lib/shallow-with-context'
import GasPriceButtonGroup from '../gas-price-button-group.component' import GasPriceButtonGroup from '../gas-price-button-group.component'
import ButtonGroup from '../../../../ui/button-group' import ButtonGroup from '../../../../ui/button-group'

View File

@ -1,9 +1,9 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import proxyquire from 'proxyquire' import proxyquire from 'proxyquire'
import sinon from 'sinon' import sinon from 'sinon'
import shallow from '../../../../../../lib/shallow-with-context'
import * as d3 from 'd3' import * as d3 from 'd3'
import shallow from '../../../../../../lib/shallow-with-context'
function timeout (time) { function timeout (time) {
return new Promise((resolve) => { return new Promise((resolve) => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'

View File

@ -1,7 +1,7 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import LoadingNetworkScreen from './loading-network-screen.component'
import * as actions from '../../../store/actions' import * as actions from '../../../store/actions'
import { getNetworkIdentifier } from '../../../selectors' import { getNetworkIdentifier } from '../../../selectors'
import LoadingNetworkScreen from './loading-network-screen.component'
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
const { const {

View File

@ -4,13 +4,13 @@ import { useHistory } from 'react-router-dom'
import { useSelector } from 'react-redux' import { useSelector } from 'react-redux'
import SelectedAccount from '../selected-account' import SelectedAccount from '../selected-account'
import ConnectedStatusIndicator from '../connected-status-indicator' import ConnectedStatusIndicator from '../connected-status-indicator'
import AccountOptionsMenu from './account-options-menu'
import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import { getEnvironmentType } from '../../../../../app/scripts/lib/util'
import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums'
import { CONNECTED_ACCOUNTS_ROUTE } from '../../../helpers/constants/routes' import { CONNECTED_ACCOUNTS_ROUTE } from '../../../helpers/constants/routes'
import { useI18nContext } from '../../../hooks/useI18nContext' import { useI18nContext } from '../../../hooks/useI18nContext'
import { useMetricEvent } from '../../../hooks/useMetricEvent' import { useMetricEvent } from '../../../hooks/useMetricEvent'
import { getOriginOfCurrentTab } from '../../../selectors' import { getOriginOfCurrentTab } from '../../../selectors'
import AccountOptionsMenu from './account-options-menu'
export default function MenuBar () { export default function MenuBar () {
const t = useI18nContext() const t = useI18nContext()

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import { Provider } from 'react-redux' import { Provider } from 'react-redux'
import configureStore from 'redux-mock-store' import configureStore from 'redux-mock-store'
import { mountWithRouter } from '../../../../../../test/lib/render-helpers' import { mountWithRouter } from '../../../../../../test/lib/render-helpers'

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'
import ModalContent from '../modal-content.component' import ModalContent from '../modal-content.component'

View File

@ -1,7 +1,7 @@
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Button from '../../ui/button'
import classnames from 'classnames' import classnames from 'classnames'
import Button from '../../ui/button'
export default class Modal extends PureComponent { export default class Modal extends PureComponent {
static propTypes = { static propTypes = {

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import { mount, shallow } from 'enzyme' import { mount, shallow } from 'enzyme'
import sinon from 'sinon' import sinon from 'sinon'
import Modal from '../modal.component' import Modal from '../modal.component'

View File

@ -1,7 +1,7 @@
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import React from 'react' import React from 'react'
import Identicon from '../../../ui/identicon'
import classnames from 'classnames' import classnames from 'classnames'
import Identicon from '../../../ui/identicon'
export default function AccountModalContainer (props, context) { export default function AccountModalContainer (props, context) {
const { const {

View File

@ -1,6 +1,6 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import AddToAddressBookModal from './add-to-addressbook-modal.component'
import * as actions from '../../../../store/actions' import * as actions from '../../../../store/actions'
import AddToAddressBookModal from './add-to-addressbook-modal.component'
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'
import CancelTransactionGasFee from '../cancel-transaction-gas-fee.component' import CancelTransactionGasFee from '../cancel-transaction-gas-fee.component'
import UserPreferencedCurrencyDisplay from '../../../../user-preferenced-currency-display' import UserPreferencedCurrencyDisplay from '../../../../user-preferenced-currency-display'

View File

@ -1,8 +1,8 @@
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Modal from '../../modal' import Modal from '../../modal'
import CancelTransactionGasFee from './cancel-transaction-gas-fee'
import { SUBMITTED_STATUS } from '../../../../helpers/constants/transactions' import { SUBMITTED_STATUS } from '../../../../helpers/constants/transactions'
import CancelTransactionGasFee from './cancel-transaction-gas-fee'
export default class CancelTransaction extends PureComponent { export default class CancelTransaction extends PureComponent {
static contextTypes = { static contextTypes = {

View File

@ -3,9 +3,9 @@ import { compose } from 'redux'
import ethUtil from 'ethereumjs-util' import ethUtil from 'ethereumjs-util'
import { multiplyCurrencies } from '../../../../helpers/utils/conversion-util' import { multiplyCurrencies } from '../../../../helpers/utils/conversion-util'
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'
import CancelTransaction from './cancel-transaction.component'
import { showModal, createCancelTransaction } from '../../../../store/actions' import { showModal, createCancelTransaction } from '../../../../store/actions'
import { getHexGasTotal } from '../../../../helpers/utils/confirm-tx.util' import { getHexGasTotal } from '../../../../helpers/utils/confirm-tx.util'
import CancelTransaction from './cancel-transaction.component'
const mapStateToProps = (state, ownProps) => { const mapStateToProps = (state, ownProps) => {
const { metamask } = state const { metamask } = state

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'
import sinon from 'sinon' import sinon from 'sinon'
import CancelTransaction from '../cancel-transaction.component' import CancelTransaction from '../cancel-transaction.component'

View File

@ -1,8 +1,8 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { compose } from 'redux' import { compose } from 'redux'
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'
import ConfirmDeleteNetwork from './confirm-delete-network.component'
import { delRpcTarget } from '../../../../store/actions' import { delRpcTarget } from '../../../../store/actions'
import ConfirmDeleteNetwork from './confirm-delete-network.component'
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import { mount } from 'enzyme' import { mount } from 'enzyme'
import ConfirmDeleteNetwork from '../index' import ConfirmDeleteNetwork from '../index'

View File

@ -1,8 +1,8 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { compose } from 'redux' import { compose } from 'redux'
import ConfirmRemoveAccount from './confirm-remove-account.component'
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'
import { removeAccount } from '../../../../store/actions' import { removeAccount } from '../../../../store/actions'
import ConfirmRemoveAccount from './confirm-remove-account.component'
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {

View File

@ -1,7 +1,7 @@
import assert from 'assert'
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { Provider } from 'react-redux' import { Provider } from 'react-redux'
import assert from 'assert'
import sinon from 'sinon' import sinon from 'sinon'
import configureStore from 'redux-mock-store' import configureStore from 'redux-mock-store'
import { mount } from 'enzyme' import { mount } from 'enzyme'

View File

@ -1,8 +1,8 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { compose } from 'redux' import { compose } from 'redux'
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'
import ConfirmResetAccount from './confirm-reset-account.component'
import { resetAccount } from '../../../../store/actions' import { resetAccount } from '../../../../store/actions'
import ConfirmResetAccount from './confirm-reset-account.component'
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import { mount } from 'enzyme' import { mount } from 'enzyme'
import ConfirmResetAccount from '../index' import ConfirmResetAccount from '../index'

View File

@ -1,12 +1,12 @@
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import log from 'loglevel' import log from 'loglevel'
import classnames from 'classnames'
import BigNumber from 'bignumber.js'
import Modal from '../../modal' import Modal from '../../modal'
import Identicon from '../../../ui/identicon' import Identicon from '../../../ui/identicon'
import TextField from '../../../ui/text-field' import TextField from '../../../ui/text-field'
import { calcTokenAmount } from '../../../../helpers/utils/token-util' import { calcTokenAmount } from '../../../../helpers/utils/token-util'
import classnames from 'classnames'
import BigNumber from 'bignumber.js'
const MAX_UNSIGNED_256_INT = new BigNumber(2).pow(256).minus(1).toString(10) const MAX_UNSIGNED_256_INT = new BigNumber(2).pow(256).minus(1).toString(10)

View File

@ -1,8 +1,8 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { compose } from 'redux' import { compose } from 'redux'
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'
import EditApprovalPermission from './edit-approval-permission.component'
import { getSelectedIdentity } from '../../../../selectors' import { getSelectedIdentity } from '../../../../selectors'
import EditApprovalPermission from './edit-approval-permission.component'
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
const modalStateProps = state.appState.modal.modalState.props || {} const modalStateProps = state.appState.modal.modalState.props || {}

View File

@ -1,4 +1,4 @@
import LoadingNetworkError from './loading-network-error.component'
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'
import LoadingNetworkError from './loading-network-error.component'
export default withModalProps(LoadingNetworkError) export default withModalProps(LoadingNetworkError)

View File

@ -1,8 +1,8 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { compose } from 'redux' import { compose } from 'redux'
import MetaMetricsOptInModal from './metametrics-opt-in-modal.component'
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'
import { setParticipateInMetaMetrics } from '../../../../store/actions' import { setParticipateInMetaMetrics } from '../../../../store/actions'
import MetaMetricsOptInModal from './metametrics-opt-in-modal.component'
const mapStateToProps = (_, ownProps) => { const mapStateToProps = (_, ownProps) => {
const { unapprovedTxCount } = ownProps const { unapprovedTxCount } = ownProps

View File

@ -1,5 +1,5 @@
import React from 'react'
import assert from 'assert' import assert from 'assert'
import React from 'react'
import sinon from 'sinon' import sinon from 'sinon'
import { mount } from 'enzyme' import { mount } from 'enzyme'
import MetaMetricsOptIn from '../index' import MetaMetricsOptIn from '../index'

View File

@ -9,6 +9,7 @@ import { getEnvironmentType } from '../../../../../app/scripts/lib/util'
import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums'
// Modal Components // Modal Components
import ConfirmCustomizeGasModal from '../gas-customization/gas-modal-page-container'
import DepositEtherModal from './deposit-ether-modal' import DepositEtherModal from './deposit-ether-modal'
import AccountDetailsModal from './account-details-modal' import AccountDetailsModal from './account-details-modal'
import ExportPrivateKeyModal from './export-private-key-modal' import ExportPrivateKeyModal from './export-private-key-modal'
@ -24,7 +25,6 @@ import CancelTransaction from './cancel-transaction'
import FadeModal from './fade-modal' import FadeModal from './fade-modal'
import MetaMetricsOptInModal from './metametrics-opt-in-modal' import MetaMetricsOptInModal from './metametrics-opt-in-modal'
import RejectTransactions from './reject-transactions' import RejectTransactions from './reject-transactions'
import ConfirmCustomizeGasModal from '../gas-customization/gas-modal-page-container'
import ConfirmDeleteNetwork from './confirm-delete-network' import ConfirmDeleteNetwork from './confirm-delete-network'
import AddToAddressBookModal from './add-to-addressbook-modal' import AddToAddressBookModal from './add-to-addressbook-modal'
import EditApprovalPermission from './edit-approval-permission' import EditApprovalPermission from './edit-approval-permission'

View File

@ -1,6 +1,6 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import NewAccountModal from './new-account-modal.component'
import * as actions from '../../../../store/actions' import * as actions from '../../../../store/actions'
import NewAccountModal from './new-account-modal.component'
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {

View File

@ -1,7 +1,7 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { hideModal, qrCodeDetected } from '../../../../store/actions'
import QrScanner from './qr-scanner.component' import QrScanner from './qr-scanner.component'
import { hideModal, qrCodeDetected } from '../../../../store/actions'
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {

View File

@ -1,7 +1,7 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { compose } from 'redux' import { compose } from 'redux'
import RejectTransactionsModal from './reject-transactions.component'
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'
import RejectTransactionsModal from './reject-transactions.component'
const mapStateToProps = (_, ownProps) => { const mapStateToProps = (_, ownProps) => {
const { unapprovedTxCount } = ownProps const { unapprovedTxCount } = ownProps

Some files were not shown because too many files have changed in this diff Show More