From c1e3c229bc008ddc7ca3507e75845ed73b837e1c Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 18 Aug 2020 16:48:25 -0230 Subject: [PATCH] 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. --- .eslintrc.js | 1 + app/scripts/background.js | 14 ++++---- app/scripts/contentscript.js | 2 +- app/scripts/controllers/app-state.js | 2 +- app/scripts/controllers/detect-tokens.js | 4 +-- app/scripts/controllers/ens/index.js | 2 +- .../controllers/network/middleware/pending.js | 2 +- app/scripts/controllers/network/network.js | 2 +- app/scripts/controllers/preferences.js | 2 +- app/scripts/controllers/threebox.js | 8 +++-- app/scripts/controllers/transactions/index.js | 10 +++--- .../controllers/transactions/tx-gas-utils.js | 2 +- .../transactions/tx-state-manager.js | 2 +- app/scripts/lib/account-tracker.js | 2 +- app/scripts/lib/decrypt-message-manager.js | 2 +- .../lib/encryption-public-key-manager.js | 2 +- app/scripts/lib/ens-ipfs/resolver.js | 2 +- app/scripts/lib/personal-message-manager.js | 2 +- app/scripts/lib/typed-message-manager.js | 4 +-- app/scripts/lib/util.js | 2 +- app/scripts/metamask-controller.js | 35 +++++++++---------- app/scripts/phishing-detect.js | 2 +- app/scripts/ui.js | 28 +++++++-------- development/build/etc.js | 2 +- development/build/scripts.js | 2 +- development/build/static.js | 2 +- development/sentry-publish.js | 4 ++- development/sourcemap-validator.js | 2 +- test/e2e/address-book.spec.js | 2 +- test/e2e/ethereum-on.spec.js | 2 +- test/e2e/fixture-server.js | 2 +- test/e2e/from-import-ui.spec.js | 2 +- test/e2e/ganache.js | 2 +- test/e2e/helpers.js | 2 +- test/e2e/incremental-security.spec.js | 2 +- test/e2e/metamask-responsive-ui.spec.js | 2 +- test/e2e/metamask-ui.spec.js | 2 +- test/e2e/permissions.spec.js | 2 +- test/e2e/send-edit.spec.js | 2 +- test/e2e/threebox.spec.js | 2 +- test/e2e/webdriver/driver.js | 2 +- test/e2e/webdriver/index.js | 2 +- test/unit/app/ComposableObservableStore.js | 2 +- .../controllers/metamask-controller-test.js | 4 +-- .../preferences-controller-test.js | 2 +- .../app/controllers/token-rates-controller.js | 2 +- .../transactions/pending-tx-tracker-test.js | 2 +- test/unit/lib/account-link.test.js | 2 +- .../responsive/components/dropdown-test.js | 2 +- .../tests/account-list-item-component.test.js | 2 +- .../account-menu/tests/account-menu.test.js | 4 +-- .../add-token-button.component.js | 2 +- ui/app/components/app/alerts/alerts.js | 2 +- .../app/app-header/app-header.container.js | 2 +- .../app/app-header/tests/app-header.test.js | 2 +- .../app/asset-list-item/asset-list-item.js | 4 +-- .../confirm-detail-row.component.test.js | 4 +-- ...onfirm-page-container-content.component.js | 2 +- .../connected-accounts-list.component.js | 2 +- .../connected-status-indicator.container.js | 2 +- .../recipient-group.component.js | 2 +- .../app/dropdowns/network-dropdown.js | 2 +- .../app/dropdowns/tests/dropdown.test.js | 2 +- .../tests/network-dropdown-icon.test.js | 2 +- .../dropdowns/tests/network-dropdown.test.js | 2 +- .../advanced-gas-input-component.test.js | 2 +- .../advanced-tab-content-component.test.js | 4 +-- .../tests/basic-tab-content-component.test.js | 2 +- .../gas-modal-page-container.container.js | 4 +-- ...gas-modal-page-container-component.test.js | 4 +-- .../gas-price-button-group-component.test.js | 4 +-- .../tests/gas-price-chart.component.test.js | 4 +-- .../app/info-box/tests/info-box.test.js | 2 +- .../loading-network-screen.container.js | 2 +- ui/app/components/app/menu-bar/menu-bar.js | 2 +- .../app/menu-bar/tests/menu-bar.test.js | 2 +- .../tests/modal-content.component.test.js | 2 +- .../components/app/modal/modal.component.js | 2 +- .../app/modal/tests/modal.component.test.js | 2 +- .../account-modal-container.component.js | 2 +- .../add-to-addressbook-modal.container.js | 2 +- ...ncel-transaction-gas-fee.component.test.js | 2 +- .../cancel-transaction.component.js | 2 +- .../cancel-transaction.container.js | 2 +- .../cancel-transaction.component.test.js | 2 +- .../confirm-delete-network.container.js | 2 +- .../tests/confirm-delete-network.test.js | 2 +- .../confirm-remove-account.container.js | 2 +- .../tests/confirm-remove-account.test.js | 2 +- .../confirm-reset-account.container.js | 2 +- .../tests/confirm-reset-account.test.js | 2 +- .../edit-approval-permission.component.js | 4 +-- .../edit-approval-permission.container.js | 2 +- .../loading-network-error.container.js | 2 +- .../metametrics-opt-in-modal.container.js | 2 +- .../tests/metametrics-opt-in-modal.test.js | 2 +- ui/app/components/app/modals/modal.js | 2 +- .../new-account-modal.container.js | 2 +- .../modals/qr-scanner/qr-scanner.container.js | 2 +- .../reject-transactions.container.js | 2 +- .../tests/reject-transactions.test.js | 2 +- .../tests/account-details-modal.test.js | 2 +- .../tests/transaction-confirmed.test.js | 2 +- .../transaction-confirmed.container.js | 2 +- .../permission-page-container.component.js | 2 +- .../permission-page-container.container.js | 2 +- .../selected-account.container.js | 2 +- .../tests/selected-account-component.test.js | 2 +- .../sidebars/tests/sidebars-component.test.js | 2 +- .../signature-request-original.container.js | 2 +- .../signature-request.component.js | 4 +-- .../signature-request.container.js | 2 +- .../tests/signature-request.test.js | 2 +- .../app/tests/signature-request.test.js | 2 +- .../components/app/token-cell/token-cell.js | 2 +- .../app/token-cell/token-cell.test.js | 4 +-- .../components/app/token-list/token-list.js | 2 +- .../transaction-action.component.test.js | 2 +- ...transaction-activity-log.component.test.js | 2 +- .../transaction-activity-log.component.js | 2 +- .../transaction-activity-log.container.js | 2 +- .../transaction-activity-log.util.js | 8 ++--- .../transaction-breakdown.component.test.js | 2 +- ...ransaction-breakdown-row.component.test.js | 2 +- .../transaction-breakdown.component.js | 2 +- .../transaction-breakdown.container.js | 2 +- ...action-list-item-details.component.test.js | 2 +- ...transaction-list-item-details.container.js | 2 +- .../transaction-list-item.component.js | 2 +- .../transaction-status.component.test.js | 2 +- ...erenced-currency-display.component.test.js | 4 +-- ...eferenced-currency-input.component.test.js | 2 +- ...er-preferenced-currency-input.container.js | 2 +- ...-preferenced-token-input.component.test.js | 2 +- .../user-preferenced-token-input.container.js | 2 +- .../app/wallet-overview/eth-overview.js | 2 +- .../app/wallet-overview/token-overview.js | 2 +- .../account-mismatch-warning.component.js | 2 +- ...cccount-mismatch-warning.component.test.js | 2 +- .../components/ui/alert/tests/alert.test.js | 2 +- .../tests/breadcrumbs.component.test.js | 2 +- .../ui/button-group/button-group.stories.js | 4 +-- .../tests/button-group-component.test.js | 2 +- ui/app/components/ui/button/button.stories.js | 2 +- .../ui/card/tests/card.component.test.js | 2 +- .../ui/check-box/check-box.stories.js | 2 +- .../tests/currency-display.component.test.js | 4 +-- .../currency-input.container.js | 2 +- .../tests/currency-input.component.test.js | 2 +- .../ui/dropdown/dropdown.stories.js | 2 +- .../tests/error-message.component.test.js | 2 +- .../tests/hex-to-decimal.component.test.js | 2 +- ui/app/components/ui/icon/icon.stories.js | 2 +- .../ui/identicon/identicon.component.js | 2 +- .../ui/identicon/identicon.stories.js | 2 +- .../tests/identicon.component.test.js | 2 +- .../ui/info-tooltip/info-tooltip.stories.js | 2 +- .../ui/list-item/list-item.stories.js | 2 +- .../ui/list-item/tests/list-item.test.js | 4 +-- ui/app/components/ui/menu/menu.stories.js | 2 +- .../tests/metafox-logo.component.test.js | 2 +- .../page-container-footer.component.test.js | 2 +- .../page-container-header.component.test.js | 2 +- .../components/ui/popover/popover.stories.js | 2 +- .../sender-to-recipient.component.js | 6 ++-- ui/app/components/ui/tabs/tabs.stories.js | 2 +- .../tests/token-input.component.test.js | 2 +- .../ui/token-input/token-input.component.js | 2 +- .../ui/token-input/token-input.container.js | 2 +- .../tests/unit-input.component.test.js | 2 +- .../confirm-transaction.duck.js | 2 +- ui/app/ducks/index.js | 2 +- ui/app/helpers/utils/common.util.test.js | 2 +- ui/app/helpers/utils/confirm-tx.util.js | 2 +- ui/app/helpers/utils/confirm-tx.util.test.js | 2 +- ui/app/helpers/utils/conversion-util.test.js | 2 +- ui/app/helpers/utils/conversions.util.test.js | 2 +- ui/app/helpers/utils/i18n-helper.test.js | 4 +-- ui/app/helpers/utils/token-util.js | 2 +- ui/app/helpers/utils/transactions.util.js | 6 ++-- .../helpers/utils/transactions.util.test.js | 2 +- ui/app/helpers/utils/util.js | 2 +- .../hooks/tests/useCancelTransaction.test.js | 2 +- ui/app/hooks/tests/useCurrencyDisplay.test.js | 2 +- .../hooks/tests/useRetryTransaction.test.js | 2 +- ui/app/hooks/tests/useTokenData.test.js | 2 +- .../hooks/tests/useTokenDisplayValue.test.js | 2 +- .../tests/useTransactionDisplayData.test.js | 2 +- .../tests/useUserPreferencedCurrency.test.js | 4 +-- ui/app/hooks/useTokenDisplayValue.js | 2 +- ui/app/hooks/useTransactionDisplayData.js | 8 ++--- ui/app/hooks/useTransactionTimeRemaining.js | 4 +-- ui/app/hooks/useUserPreferencedCurrency.js | 2 +- ui/app/pages/add-token/add-token.component.js | 4 +-- ui/app/pages/add-token/add-token.container.js | 2 +- .../pages/add-token/tests/add-token.test.js | 2 +- .../confirm-add-suggested-token.container.js | 2 +- .../confirm-add-token.container.js | 2 +- .../pages/confirm-approve/confirm-approve.js | 4 +-- .../confirm-decrypt-message.container.js | 2 +- ...confirm-encryption-public-key.container.js | 2 +- .../confirm-send-token.container.js | 2 +- ...onfirm-token-transaction-base.container.js | 2 +- .../confirm-transaction-base.container.js | 2 +- .../confirm-transaction-switch.container.js | 2 +- ui/app/pages/confirm-transaction/conf-tx.js | 2 +- .../confirm-transaction.component.js | 2 +- .../confirm-transaction.container.js | 2 +- .../connected-accounts.container.js | 2 +- .../connected-sites.container.js | 2 +- .../create-account/connect-hardware/index.js | 4 +-- .../create-account.component.js | 6 ++-- .../create-account/import-account/json.js | 2 +- .../create-account/new-account.container.js | 2 +- .../tests/create-account.test.js | 2 +- .../create-password.component.js | 4 +-- .../import-with-seed-phrase.container.js | 2 +- .../import-with-seed-phrase.component.test.js | 2 +- .../end-of-flow/end-of-flow.container.js | 2 +- .../end-of-flow/tests/end-of-flow.test.js | 2 +- .../tests/first-time-flow-switch.test.js | 2 +- .../first-time-flow.component.js | 14 ++++---- .../first-time-flow.container.js | 2 +- .../metametrics-opt-in.container.js | 2 +- .../tests/metametrics-opt-in.test.js | 2 +- .../confirm-seed-phrase.container.js | 2 +- .../reveal-seed-phrase.container.js | 2 +- .../tests/reveal-seed-phrase.test.js | 2 +- .../seed-phrase/seed-phrase.component.js | 8 ++--- .../confirm-seed-phrase-component.test.js | 2 +- .../select-action/tests/select-action.test.js | 2 +- .../welcome/tests/welcome.test.js | 2 +- ui/app/pages/home/home.container.js | 2 +- ui/app/pages/index.js | 4 +-- .../pages/keychains/tests/reveal-seed.test.js | 2 +- ui/app/pages/lock/lock.container.js | 2 +- ui/app/pages/lock/tests/lock.test.js | 2 +- .../mobile-sync/mobile-sync.container.js | 2 +- .../permissions-connect.container.js | 2 +- ui/app/pages/routes/routes.container.js | 2 +- .../add-recipient/add-recipient.js | 4 +-- .../add-recipient/ens-input.component.js | 4 +-- .../add-recipient/ens-input.container.js | 2 +- .../tests/add-recipient-component.test.js | 2 +- .../amount-max-button.container.js | 4 +-- .../amount-max-button.utils.js | 2 +- .../tests/amount-max-button-component.test.js | 2 +- .../send-amount-row.component.js | 2 +- .../tests/send-amount-row-component.test.js | 2 +- .../send-asset-row.container.js | 2 +- .../send-content/send-content.component.js | 2 +- .../send-content/send-content.container.js | 2 +- .../tests/gas-fee-display.component.test.js | 4 +-- .../send-gas-row/send-gas-row.component.js | 2 +- .../tests/send-gas-row-component.test.js | 2 +- .../send-row-error-message-component.test.js | 2 +- .../tests/send-row-wrapper-component.test.js | 2 +- .../tests/send-content-component.test.js | 2 +- .../send/send-footer/send-footer.container.js | 2 +- .../tests/send-footer-component.test.js | 2 +- .../send/send-header/send-header.container.js | 2 +- .../tests/send-header-component.test.js | 2 +- ui/app/pages/send/send.component.js | 2 +- ui/app/pages/send/send.container.js | 8 ++--- ui/app/pages/send/send.utils.js | 4 +-- .../pages/send/tests/send-component.test.js | 2 +- .../advanced-tab/advanced-tab.container.js | 2 +- .../tests/advanced-tab-component.test.js | 2 +- .../add-contact/add-contact.component.js | 2 +- .../add-contact/add-contact.container.js | 2 +- .../contact-list-tab.component.js | 8 ++--- .../contact-list-tab.container.js | 2 +- .../edit-contact/edit-contact.container.js | 2 +- .../my-accounts/my-accounts.container.js | 2 +- .../view-contact/view-contact.container.js | 2 +- .../networks-tab/networks-tab.component.js | 4 +-- .../networks-tab/networks-tab.container.js | 2 +- .../security-tab/security-tab.container.js | 2 +- .../security-tab/tests/security-tab.test.js | 2 +- .../settings-tab/settings-tab.container.js | 2 +- .../settings-tab/tests/settings-tab.test.js | 2 +- ui/app/pages/settings/settings.component.js | 16 ++++----- ui/app/pages/settings/settings.container.js | 2 +- .../pages/token/fee-card/fee-card.stories.js | 2 +- .../unlock-page/tests/unlock-page.test.js | 2 +- .../unlock-page/unlock-page.component.js | 4 +-- ui/app/selectors/custom-gas.js | 8 ++--- ui/app/selectors/permissions.js | 2 +- ui/app/selectors/selectors.js | 2 +- ui/app/selectors/send.js | 2 +- ui/app/selectors/transactions.js | 2 +- ui/app/store/actions.js | 6 ++-- ui/index.js | 8 ++--- ui/lib/icon-factory.js | 2 +- ui/lib/tx-helper.js | 2 +- 295 files changed, 415 insertions(+), 411 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index fc0add36e..682219053 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -50,6 +50,7 @@ module.exports = { 'implicit-arrow-linebreak': 'error', 'import/extensions': ['error', 'never', { 'json': 'always' }], 'import/no-extraneous-dependencies': 'error', + 'import/order': 'error', 'import/unambiguous': 'error', 'max-statements-per-line': ['error', { 'max': 1 }], 'no-case-declarations': 'error', diff --git a/app/scripts/background.js b/app/scripts/background.js index c890441c9..fcf504107 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -1,11 +1,11 @@ /** * @file The entry point for the web extension singleton process. */ - - // these need to run before anything else +/* eslint-disable import/order */ import './lib/freezeGlobals' import setupFetchDebugging from './lib/setupFetchDebugging' +/* eslint-enable import/order */ setupFetchDebugging() @@ -17,14 +17,14 @@ import pump from 'pump' import debounce from 'debounce-stream' import log from 'loglevel' import extension from 'extensionizer' -import ReadOnlyNetworkStore from './lib/network-store' -import LocalStore from './lib/local-store' import storeTransform from 'obs-store/lib/transform' 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 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 NotificationManager from './lib/notification-manager' import MetamaskController from './metamask-controller' diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index e7a983a69..8926f439c 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -1,5 +1,5 @@ -import pump from 'pump' import querystring from 'querystring' +import pump from 'pump' import LocalMessageDuplexStream from 'post-message-stream' import ObjectMultiplex from 'obj-multiplex' import extension from 'extensionizer' diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index d43c74670..e967b462b 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -1,5 +1,5 @@ -import ObservableStore from 'obs-store' import EventEmitter from 'events' +import ObservableStore from 'obs-store' export default class AppStateController extends EventEmitter { /** diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js index 6b7424f98..93b7af2a6 100644 --- a/app/scripts/controllers/detect-tokens.js +++ b/app/scripts/controllers/detect-tokens.js @@ -1,11 +1,11 @@ import Web3 from 'web3' import contracts from 'eth-contract-metadata' import { warn } from 'loglevel' +import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi' import { MAINNET } from './network/enums' + // By default, poll every 3 minutes const DEFAULT_INTERVAL = 180 * 1000 -import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi' - const SINGLE_CALL_BALANCES_ADDRESS = '0xb1f8e55c7f64d203c1400b9d8555d050f94adf39' /** * A controller that polls for token exchange diff --git a/app/scripts/controllers/ens/index.js b/app/scripts/controllers/ens/index.js index e44a97ca3..d900bf4e6 100644 --- a/app/scripts/controllers/ens/index.js +++ b/app/scripts/controllers/ens/index.js @@ -1,6 +1,6 @@ +import punycode from 'punycode' import ethUtil from 'ethereumjs-util' import ObservableStore from 'obs-store' -import punycode from 'punycode' import log from 'loglevel' import Ens from './ens' diff --git a/app/scripts/controllers/network/middleware/pending.js b/app/scripts/controllers/network/middleware/pending.js index 95e86f3c9..1a67688c9 100644 --- a/app/scripts/controllers/network/middleware/pending.js +++ b/app/scripts/controllers/network/middleware/pending.js @@ -1,5 +1,5 @@ -import { formatTxMetaForRpcResult } from '../util' import createAsyncMiddleware from 'json-rpc-engine/src/createAsyncMiddleware' +import { formatTxMetaForRpcResult } from '../util' export function createPendingNonceMiddleware ({ getPendingNonce }) { return createAsyncMiddleware(async (req, res, next) => { diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 90a60f8cd..7d45cc5a4 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -6,11 +6,11 @@ import EthQuery from 'eth-query' import JsonRpcEngine from 'json-rpc-engine' import providerFromEngine from 'eth-json-rpc-middleware/providerFromEngine' import log from 'loglevel' +import { createSwappableProxy, createEventEmitterProxy } from 'swappable-obj-proxy' import createMetamaskMiddleware from './createMetamaskMiddleware' import createInfuraClient from './createInfuraClient' import createJsonRpcClient from './createJsonRpcClient' import createLocalhostClient from './createLocalhostClient' -import { createSwappableProxy, createEventEmitterProxy } from 'swappable-obj-proxy' const networks = { networkList: {} } diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 3a871f473..436648af8 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -1,7 +1,7 @@ import ObservableStore from 'obs-store' -import { addInternalMethodPrefix } from './permissions' import { normalize as normalizeAddress } from 'eth-sig-util' import { isValidAddress, sha3, bufferToHex } from 'ethereumjs-util' +import { addInternalMethodPrefix } from './permissions' export default class PreferencesController { diff --git a/app/scripts/controllers/threebox.js b/app/scripts/controllers/threebox.js index 726a14ffa..92e4ae907 100644 --- a/app/scripts/controllers/threebox.js +++ b/app/scripts/controllers/threebox.js @@ -1,16 +1,18 @@ import ObservableStore from 'obs-store' +/* eslint-disable import/order */ const Box = process.env.IN_TEST ? require('../../../development/mock-3box') : require('3box') +/* eslint-enable import/order */ import log from 'loglevel' -import migrations from '../migrations' -import Migrator from '../lib/migrator' import JsonRpcEngine from 'json-rpc-engine' 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 createMetamaskMiddleware from './network/createMetamaskMiddleware' const SYNC_TIMEOUT = 60 * 1000 // one minute diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 543603f83..22ace157e 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -9,6 +9,8 @@ import abiDecoder from 'abi-decoder' abiDecoder.addABI(abi) +import NonceTracker from 'nonce-tracker' +import log from 'loglevel' import { TOKEN_METHOD_APPROVE, TOKEN_METHOD_TRANSFER, @@ -18,13 +20,13 @@ import { CONTRACT_INTERACTION_KEY, } 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 TxGasUtil from './tx-gas-utils' import PendingTransactionTracker from './pending-tx-tracker' -import NonceTracker from 'nonce-tracker' import * as txUtils from './lib/util' -import cleanErrorStack from '../../lib/cleanErrorStack' -import log from 'loglevel' import { TRANSACTION_TYPE_CANCEL, @@ -33,8 +35,6 @@ import { TRANSACTION_STATUS_APPROVED, } 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 MAX_MEMSTORE_TX_LIST_SIZE = 100 // Number of transactions (by unique nonces) to keep in memory diff --git a/app/scripts/controllers/transactions/tx-gas-utils.js b/app/scripts/controllers/transactions/tx-gas-utils.js index 1fca82afd..081282066 100644 --- a/app/scripts/controllers/transactions/tx-gas-utils.js +++ b/app/scripts/controllers/transactions/tx-gas-utils.js @@ -1,6 +1,6 @@ import EthQuery from 'ethjs-query' -import { hexToBn, BnMultiplyByFraction, bnToHex } from '../../lib/util' 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 diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 89eaf2464..5239bd60a 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -1,8 +1,8 @@ import EventEmitter from 'safe-event-emitter' import ObservableStore from 'obs-store' import log from 'loglevel' -import { generateHistoryEntry, replayHistory, snapshotFromTxMeta } from './lib/tx-state-history-helpers' import createId from '../../lib/random-id' +import { generateHistoryEntry, replayHistory, snapshotFromTxMeta } from './lib/tx-state-history-helpers' import { getFinalStates, normalizeTxParams } from './lib/util' /** TransactionStateManager is responsible for the state of a transaction and diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js index 4ce0d692e..f84a9708b 100644 --- a/app/scripts/lib/account-tracker.js +++ b/app/scripts/lib/account-tracker.js @@ -14,7 +14,6 @@ import log from 'loglevel' import pify from 'pify' import Web3 from 'web3' 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 { @@ -23,6 +22,7 @@ import { SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN, SINGLE_CALL_BALANCES_ADDRESS_KOVAN, } from '../controllers/network/contract-addresses' +import { bnToHex } from './util' export default class AccountTracker { diff --git a/app/scripts/lib/decrypt-message-manager.js b/app/scripts/lib/decrypt-message-manager.js index d6986f52f..060a11d9b 100644 --- a/app/scripts/lib/decrypt-message-manager.js +++ b/app/scripts/lib/decrypt-message-manager.js @@ -2,11 +2,11 @@ import EventEmitter from 'events' import ObservableStore from 'obs-store' import ethUtil from 'ethereumjs-util' import { ethErrors } from 'eth-json-rpc-errors' +import log from 'loglevel' import createId from './random-id' import { MESSAGE_TYPE } from './enums' 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 diff --git a/app/scripts/lib/encryption-public-key-manager.js b/app/scripts/lib/encryption-public-key-manager.js index 7550a26e3..8d78bf8bd 100644 --- a/app/scripts/lib/encryption-public-key-manager.js +++ b/app/scripts/lib/encryption-public-key-manager.js @@ -1,8 +1,8 @@ import EventEmitter from 'events' import ObservableStore from 'obs-store' import { ethErrors } from 'eth-json-rpc-errors' -import createId from './random-id' import log from 'loglevel' +import createId from './random-id' import { MESSAGE_TYPE } from './enums' /** diff --git a/app/scripts/lib/ens-ipfs/resolver.js b/app/scripts/lib/ens-ipfs/resolver.js index 475432ba1..67acba8c7 100644 --- a/app/scripts/lib/ens-ipfs/resolver.js +++ b/app/scripts/lib/ens-ipfs/resolver.js @@ -1,9 +1,9 @@ import namehash from 'eth-ens-namehash' import Eth from 'ethjs-query' import EthContract from 'ethjs-contract' +import contentHash from 'content-hash' import registryAbi from './contracts/registry' import resolverAbi from './contracts/resolver' -import contentHash from 'content-hash' export default async function resolveEnsToIpfsContentId ({ provider, name }) { const eth = new Eth(provider) diff --git a/app/scripts/lib/personal-message-manager.js b/app/scripts/lib/personal-message-manager.js index 7770e8106..7e6ac3c4e 100644 --- a/app/scripts/lib/personal-message-manager.js +++ b/app/scripts/lib/personal-message-manager.js @@ -2,11 +2,11 @@ import EventEmitter from 'events' import ObservableStore from 'obs-store' import ethUtil from 'ethereumjs-util' import { ethErrors } from 'eth-json-rpc-errors' +import log from 'loglevel' import createId from './random-id' import { MESSAGE_TYPE } from './enums' 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 diff --git a/app/scripts/lib/typed-message-manager.js b/app/scripts/lib/typed-message-manager.js index b582396d3..324ef6936 100644 --- a/app/scripts/lib/typed-message-manager.js +++ b/app/scripts/lib/typed-message-manager.js @@ -1,12 +1,12 @@ import EventEmitter from 'events' -import ObservableStore from 'obs-store' -import createId from './random-id' import assert from 'assert' +import ObservableStore from 'obs-store' import { ethErrors } from 'eth-json-rpc-errors' import sigUtil from 'eth-sig-util' import { isValidAddress } from 'ethereumjs-util' import log from 'loglevel' import jsonschema from 'jsonschema' +import createId from './random-id' import { MESSAGE_TYPE } from './enums' /** diff --git a/app/scripts/lib/util.js b/app/scripts/lib/util.js index ab8653669..243a00b65 100644 --- a/app/scripts/lib/util.js +++ b/app/scripts/lib/util.js @@ -1,6 +1,6 @@ +import assert from 'assert' import extension from 'extensionizer' import ethUtil from 'ethereumjs-util' -import assert from 'assert' import BN from 'bn.js' import { memoize } from 'lodash' diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 8790e4b69..656777eb2 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -10,22 +10,35 @@ import pump from 'pump' import Dnode from 'dnode' import extension from 'extensionizer' import ObservableStore from 'obs-store' -import ComposableObservableStore from './lib/ComposableObservableStore' import asStream from 'obs-store/lib/asStream' -import AccountTracker from './lib/account-tracker' import RpcEngine from 'json-rpc-engine' import { debounce } from 'lodash' import createEngineStream from 'json-rpc-middleware-stream/engineStream' import createFilterMiddleware from 'eth-json-rpc-filters' 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 createMethodMiddleware from './lib/createMethodMiddleware' import createOriginMiddleware from './lib/createOriginMiddleware' import createTabIdMiddleware from './lib/createTabIdMiddleware' import createOnboardingMiddleware from './lib/createOnboardingMiddleware' -import providerAsMiddleware from 'eth-json-rpc-middleware/providerAsMiddleware' import { setupMultiplex } from './lib/stream-utils' -import KeyringController from 'eth-keyring-controller' import EnsController from './controllers/ens' import NetworkController from './controllers/network' import PreferencesController from './controllers/preferences' @@ -48,22 +61,8 @@ import getRestrictedMethods from './controllers/permissions/restrictedMethods' import nodeify from './lib/nodeify' import accountImporter from './account-import-strategies' 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 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' diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index f3333fb5e..6311b7004 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -1,6 +1,6 @@ import querystring from 'querystring' -import dnode from 'dnode' import { EventEmitter } from 'events' +import dnode from 'dnode' import PortStream from 'extension-port-stream' import extension from 'extensionizer' import { setupMultiplex } from './lib/stream-utils' diff --git a/app/scripts/ui.js b/app/scripts/ui.js index ab05303ef..7a76b8778 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -6,26 +6,26 @@ import './lib/freezeGlobals' import 'abortcontroller-polyfill/dist/polyfill-patch-fetch' import '@formatjs/intl-relativetimeformat/polyfill' +import { EventEmitter } from 'events' 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 { ENVIRONMENT_TYPE_FULLSCREEN, ENVIRONMENT_TYPE_POPUP, } from './lib/enums' - -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' +import { getEnvironmentType } from './lib/util' start().catch(log.error) diff --git a/development/build/etc.js b/development/build/etc.js index 0dbce1255..81b9a17b7 100644 --- a/development/build/etc.js +++ b/development/build/etc.js @@ -1,7 +1,7 @@ +const { promises: fs } = require('fs') const gulp = require('gulp') const gulpZip = require('gulp-zip') const del = require('del') -const { promises: fs } = require('fs') const pify = require('pify') const pump = pify(require('pump')) const baseManifest = require('../../app/manifest/_base.json') diff --git a/development/build/scripts.js b/development/build/scripts.js index 0831dbf69..1f6d2f954 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -17,8 +17,8 @@ const { makeStringTransform } = require('browserify-transform-tools') const conf = require('rc')('metamask', {}) -const { createTask, composeParallel, composeSeries, runInChildProcess } = require('./task') const packageJSON = require('../../package.json') +const { createTask, composeParallel, composeSeries, runInChildProcess } = require('./task') module.exports = createScriptTasks diff --git a/development/build/static.js b/development/build/static.js index 62dbeaa62..f32cd5c39 100644 --- a/development/build/static.js +++ b/development/build/static.js @@ -1,5 +1,5 @@ -const fs = require('fs-extra') const path = require('path') +const fs = require('fs-extra') const watch = require('gulp-watch') const glob = require('fast-glob') diff --git a/development/sentry-publish.js b/development/sentry-publish.js index 650ac37fd..80c373608 100644 --- a/development/sentry-publish.js +++ b/development/sentry-publish.js @@ -1,6 +1,8 @@ #!/usr/bin/env node +const childProcess = require('child_process') 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 start().catch(console.error) diff --git a/development/sourcemap-validator.js b/development/sourcemap-validator.js index cfb569138..0babb1d56 100644 --- a/development/sourcemap-validator.js +++ b/development/sourcemap-validator.js @@ -1,6 +1,6 @@ const fs = require('fs') -const { SourceMapConsumer } = require('source-map') const path = require('path') +const { SourceMapConsumer } = require('source-map') const pify = require('pify') const fsAsync = pify(fs) diff --git a/test/e2e/address-book.spec.js b/test/e2e/address-book.spec.js index fdd0b6b28..85cef65de 100644 --- a/test/e2e/address-book.spec.js +++ b/test/e2e/address-book.spec.js @@ -1,6 +1,7 @@ const assert = require('assert') const { By, until } = require('selenium-webdriver') +const enLocaleMessages = require('../../app/_locales/en/messages.json') const { tinyDelayMs, regularDelayMs, @@ -8,7 +9,6 @@ const { } = require('./helpers') const { buildWebDriver } = require('./webdriver') const Ganache = require('./ganache') -const enLocaleMessages = require('../../app/_locales/en/messages.json') const ganacheServer = new Ganache() diff --git a/test/e2e/ethereum-on.spec.js b/test/e2e/ethereum-on.spec.js index 8c0426a0d..5dd15d5fd 100644 --- a/test/e2e/ethereum-on.spec.js +++ b/test/e2e/ethereum-on.spec.js @@ -2,13 +2,13 @@ const assert = require('assert') const webdriver = require('selenium-webdriver') const { By, until } = webdriver +const enLocaleMessages = require('../../app/_locales/en/messages.json') const { regularDelayMs, largeDelayMs, } = require('./helpers') const { buildWebDriver } = require('./webdriver') const Ganache = require('./ganache') -const enLocaleMessages = require('../../app/_locales/en/messages.json') const ganacheServer = new Ganache() diff --git a/test/e2e/fixture-server.js b/test/e2e/fixture-server.js index f923c0a26..b96ba8e9a 100644 --- a/test/e2e/fixture-server.js +++ b/test/e2e/fixture-server.js @@ -1,6 +1,6 @@ const { promises: fs } = require('fs') -const Koa = require('koa') const path = require('path') +const Koa = require('koa') const CURRENT_STATE_KEY = '__CURRENT__' const DEFAULT_STATE_KEY = '__DEFAULT__' diff --git a/test/e2e/from-import-ui.spec.js b/test/e2e/from-import-ui.spec.js index b0eab48e4..d471f41f3 100644 --- a/test/e2e/from-import-ui.spec.js +++ b/test/e2e/from-import-ui.spec.js @@ -2,13 +2,13 @@ const assert = require('assert') const webdriver = require('selenium-webdriver') const { By, Key, until } = webdriver +const enLocaleMessages = require('../../app/_locales/en/messages.json') const { regularDelayMs, largeDelayMs, } = require('./helpers') const { buildWebDriver } = require('./webdriver') const Ganache = require('./ganache') -const enLocaleMessages = require('../../app/_locales/en/messages.json') const ganacheServer = new Ganache() diff --git a/test/e2e/ganache.js b/test/e2e/ganache.js index 29cc085bc..0cfbadda3 100644 --- a/test/e2e/ganache.js +++ b/test/e2e/ganache.js @@ -1,5 +1,5 @@ -const ganache = require('ganache-core') const { promisify } = require('util') +const ganache = require('ganache-core') const defaultOptions = { blockTime: 2, diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js index 1611e66da..b06efb3ec 100644 --- a/test/e2e/helpers.js +++ b/test/e2e/helpers.js @@ -1,8 +1,8 @@ const path = require('path') +const createStaticServer = require('../../development/create-static-server') const Ganache = require('./ganache') const FixtureServer = require('./fixture-server') const { buildWebDriver } = require('./webdriver') -const createStaticServer = require('../../development/create-static-server') const tinyDelayMs = 200 const regularDelayMs = tinyDelayMs * 2 diff --git a/test/e2e/incremental-security.spec.js b/test/e2e/incremental-security.spec.js index 1e1a30349..6b76bae12 100644 --- a/test/e2e/incremental-security.spec.js +++ b/test/e2e/incremental-security.spec.js @@ -2,6 +2,7 @@ const assert = require('assert') const webdriver = require('selenium-webdriver') const { By, until } = webdriver +const enLocaleMessages = require('../../app/_locales/en/messages.json') const { tinyDelayMs, regularDelayMs, @@ -9,7 +10,6 @@ const { } = require('./helpers') const { buildWebDriver } = require('./webdriver') const Ganache = require('./ganache') -const enLocaleMessages = require('../../app/_locales/en/messages.json') const ganacheServer = new Ganache() diff --git a/test/e2e/metamask-responsive-ui.spec.js b/test/e2e/metamask-responsive-ui.spec.js index b2d8e9c5e..b776299d4 100644 --- a/test/e2e/metamask-responsive-ui.spec.js +++ b/test/e2e/metamask-responsive-ui.spec.js @@ -2,6 +2,7 @@ const assert = require('assert') const webdriver = require('selenium-webdriver') const { By, until } = webdriver +const enLocaleMessages = require('../../app/_locales/en/messages.json') const { tinyDelayMs, regularDelayMs, @@ -9,7 +10,6 @@ const { } = require('./helpers') const { buildWebDriver } = require('./webdriver') const Ganache = require('./ganache') -const enLocaleMessages = require('../../app/_locales/en/messages.json') const ganacheServer = new Ganache() diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index bb13c0646..c1c7a953d 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -2,6 +2,7 @@ const assert = require('assert') const webdriver = require('selenium-webdriver') const { By, Key, until } = webdriver +const enLocaleMessages = require('../../app/_locales/en/messages.json') const { tinyDelayMs, regularDelayMs, @@ -9,7 +10,6 @@ const { } = require('./helpers') const { buildWebDriver } = require('./webdriver') const Ganache = require('./ganache') -const enLocaleMessages = require('../../app/_locales/en/messages.json') const ganacheServer = new Ganache() diff --git a/test/e2e/permissions.spec.js b/test/e2e/permissions.spec.js index cd6cef453..87c439c0c 100644 --- a/test/e2e/permissions.spec.js +++ b/test/e2e/permissions.spec.js @@ -2,13 +2,13 @@ const assert = require('assert') const webdriver = require('selenium-webdriver') const { By, until } = webdriver +const enLocaleMessages = require('../../app/_locales/en/messages.json') const { regularDelayMs, largeDelayMs, } = require('./helpers') const { buildWebDriver } = require('./webdriver') const Ganache = require('./ganache') -const enLocaleMessages = require('../../app/_locales/en/messages.json') const ganacheServer = new Ganache() diff --git a/test/e2e/send-edit.spec.js b/test/e2e/send-edit.spec.js index ddf9bfde4..4f7e0ae54 100644 --- a/test/e2e/send-edit.spec.js +++ b/test/e2e/send-edit.spec.js @@ -2,6 +2,7 @@ const assert = require('assert') const webdriver = require('selenium-webdriver') const { By, until } = webdriver +const enLocaleMessages = require('../../app/_locales/en/messages.json') const { tinyDelayMs, regularDelayMs, @@ -9,7 +10,6 @@ const { } = require('./helpers') const { buildWebDriver } = require('./webdriver') const Ganache = require('./ganache') -const enLocaleMessages = require('../../app/_locales/en/messages.json') const ganacheServer = new Ganache() diff --git a/test/e2e/threebox.spec.js b/test/e2e/threebox.spec.js index 6d46e0377..3ba7c060e 100644 --- a/test/e2e/threebox.spec.js +++ b/test/e2e/threebox.spec.js @@ -3,6 +3,7 @@ const webdriver = require('selenium-webdriver') const getPort = require('get-port') const { By, until } = webdriver +const enLocaleMessages = require('../../app/_locales/en/messages.json') const { tinyDelayMs, regularDelayMs, @@ -10,7 +11,6 @@ const { } = require('./helpers') const { buildWebDriver } = require('./webdriver') const Ganache = require('./ganache') -const enLocaleMessages = require('../../app/_locales/en/messages.json') const ganacheServer = new Ganache() diff --git a/test/e2e/webdriver/driver.js b/test/e2e/webdriver/driver.js index 8f1bc6744..2d8556850 100644 --- a/test/e2e/webdriver/driver.js +++ b/test/e2e/webdriver/driver.js @@ -1,6 +1,6 @@ const { promises: fs } = require('fs') -const { until, error: webdriverError } = require('selenium-webdriver') const { strict: assert } = require('assert') +const { until, error: webdriverError } = require('selenium-webdriver') class Driver { /** diff --git a/test/e2e/webdriver/index.js b/test/e2e/webdriver/index.js index 916b7db36..23e5acd5a 100644 --- a/test/e2e/webdriver/index.js +++ b/test/e2e/webdriver/index.js @@ -1,8 +1,8 @@ const { Browser } = require('selenium-webdriver') +const fetchMockResponses = require('../../data/fetch-mocks.json') const Driver = require('./driver') const ChromeDriver = require('./chrome') const FirefoxDriver = require('./firefox') -const fetchMockResponses = require('../../data/fetch-mocks.json') async function buildWebDriver ({ responsive, port } = {}) { const browser = process.env.SELENIUM_BROWSER diff --git a/test/unit/app/ComposableObservableStore.js b/test/unit/app/ComposableObservableStore.js index 4eb5f0299..961be1dc0 100644 --- a/test/unit/app/ComposableObservableStore.js +++ b/test/unit/app/ComposableObservableStore.js @@ -1,6 +1,6 @@ import assert from 'assert' -import ComposableObservableStore from '../../../app/scripts/lib/ComposableObservableStore' import ObservableStore from 'obs-store' +import ComposableObservableStore from '../../../app/scripts/lib/ComposableObservableStore' describe('ComposableObservableStore', function () { it('should register initial state', function () { diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js index b69b0c0a9..09000890f 100644 --- a/test/unit/app/controllers/metamask-controller-test.js +++ b/test/unit/app/controllers/metamask-controller-test.js @@ -4,10 +4,10 @@ import { cloneDeep } from 'lodash' import nock from 'nock' import ethUtil from 'ethereumjs-util' import { obj as createThoughStream } from 'through2' -import firstTimeState from '../../localhostState' -import createTxMeta from '../../../lib/createTxMeta' import EthQuery from 'eth-query' import proxyquire from 'proxyquire' +import firstTimeState from '../../localhostState' +import createTxMeta from '../../../lib/createTxMeta' const threeBoxSpies = { init: sinon.stub(), diff --git a/test/unit/app/controllers/preferences-controller-test.js b/test/unit/app/controllers/preferences-controller-test.js index 450aa1ab1..5c56b0f88 100644 --- a/test/unit/app/controllers/preferences-controller-test.js +++ b/test/unit/app/controllers/preferences-controller-test.js @@ -1,8 +1,8 @@ import assert from 'assert' import ObservableStore from 'obs-store' +import sinon from 'sinon' import PreferencesController from '../../../../app/scripts/controllers/preferences' import { addInternalMethodPrefix } from '../../../../app/scripts/controllers/permissions' -import sinon from 'sinon' describe('preferences controller', function () { let preferencesController diff --git a/test/unit/app/controllers/token-rates-controller.js b/test/unit/app/controllers/token-rates-controller.js index 2bc341d22..1f342abe5 100644 --- a/test/unit/app/controllers/token-rates-controller.js +++ b/test/unit/app/controllers/token-rates-controller.js @@ -1,7 +1,7 @@ import assert from 'assert' import sinon from 'sinon' -import TokenRatesController from '../../../../app/scripts/controllers/token-rates' import ObservableStore from 'obs-store' +import TokenRatesController from '../../../../app/scripts/controllers/token-rates' describe('TokenRatesController', function () { it('should listen for preferences store updates', function () { diff --git a/test/unit/app/controllers/transactions/pending-tx-tracker-test.js b/test/unit/app/controllers/transactions/pending-tx-tracker-test.js index 000ad263d..bbdc72551 100644 --- a/test/unit/app/controllers/transactions/pending-tx-tracker-test.js +++ b/test/unit/app/controllers/transactions/pending-tx-tracker-test.js @@ -1,5 +1,5 @@ -import sinon from 'sinon' import { strict as assert } from 'assert' +import sinon from 'sinon' import BN from 'bn.js' import PendingTransactionTracker from '../../../../../app/scripts/controllers/transactions/pending-tx-tracker' diff --git a/test/unit/lib/account-link.test.js b/test/unit/lib/account-link.test.js index a37bdfcb5..8ba9404e4 100644 --- a/test/unit/lib/account-link.test.js +++ b/test/unit/lib/account-link.test.js @@ -1,5 +1,5 @@ -import getAccountLink from '../../../ui/lib/account-link' import assert from 'assert' +import getAccountLink from '../../../ui/lib/account-link' describe('Account link', function () { describe('getAccountLink', function () { diff --git a/test/unit/responsive/components/dropdown-test.js b/test/unit/responsive/components/dropdown-test.js index 76258277f..754879aee 100644 --- a/test/unit/responsive/components/dropdown-test.js +++ b/test/unit/responsive/components/dropdown-test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import configureMockStore from 'redux-mock-store' import thunk from 'redux-thunk' import sinon from 'sinon' diff --git a/ui/app/components/app/account-list-item/tests/account-list-item-component.test.js b/ui/app/components/app/account-list-item/tests/account-list-item-component.test.js index ee4ef3c89..46630bfcc 100644 --- a/ui/app/components/app/account-list-item/tests/account-list-item-component.test.js +++ b/ui/app/components/app/account-list-item/tests/account-list-item-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import * as utils from '../../../../helpers/utils/util' diff --git a/ui/app/components/app/account-menu/tests/account-menu.test.js b/ui/app/components/app/account-menu/tests/account-menu.test.js index f4e5e1062..5dfbd4f1d 100644 --- a/ui/app/components/app/account-menu/tests/account-menu.test.js +++ b/ui/app/components/app/account-menu/tests/account-menu.test.js @@ -1,10 +1,10 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import configureMockStore from 'redux-mock-store' +import { Provider } from 'react-redux' import { mountWithRouter } from '../../../../../../test/lib/render-helpers' import AccountMenu from '../index' -import { Provider } from 'react-redux' describe('Account Menu', function () { diff --git a/ui/app/components/app/add-token-button/add-token-button.component.js b/ui/app/components/app/add-token-button/add-token-button.component.js index e1a40d563..b1d327a21 100644 --- a/ui/app/components/app/add-token-button/add-token-button.component.js +++ b/ui/app/components/app/add-token-button/add-token-button.component.js @@ -1,7 +1,7 @@ import React from 'react' +import { useHistory } from 'react-router-dom' import { useMetricEvent } from '../../../hooks/useMetricEvent' import { useI18nContext } from '../../../hooks/useI18nContext' -import { useHistory } from 'react-router-dom' import { ADD_TOKEN_ROUTE } from '../../../helpers/constants/routes' import Button from '../../ui/button' diff --git a/ui/app/components/app/alerts/alerts.js b/ui/app/components/app/alerts/alerts.js index 5d376494c..72bb4910a 100644 --- a/ui/app/components/app/alerts/alerts.js +++ b/ui/app/components/app/alerts/alerts.js @@ -1,8 +1,8 @@ import React from 'react' import { useSelector } from 'react-redux' -import UnconnectedAccountAlert from './unconnected-account-alert' import { alertIsOpen as unconnectedAccountAlertIsOpen } from '../../../ducks/alerts/unconnected-account' +import UnconnectedAccountAlert from './unconnected-account-alert' const Alerts = () => { const _unconnectedAccountAlertIsOpen = useSelector(unconnectedAccountAlertIsOpen) diff --git a/ui/app/components/app/app-header/app-header.container.js b/ui/app/components/app/app-header/app-header.container.js index 78c425436..955f2f320 100644 --- a/ui/app/components/app/app-header/app-header.container.js +++ b/ui/app/components/app/app-header/app-header.container.js @@ -2,8 +2,8 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'redux' -import AppHeader from './app-header.component' import * as actions from '../../../store/actions' +import AppHeader from './app-header.component' const mapStateToProps = (state) => { const { appState, metamask } = state diff --git a/ui/app/components/app/app-header/tests/app-header.test.js b/ui/app/components/app/app-header/tests/app-header.test.js index ece8e498c..e70684a09 100644 --- a/ui/app/components/app/app-header/tests/app-header.test.js +++ b/ui/app/components/app/app-header/tests/app-header.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { shallow } from 'enzyme' import MetaFoxLogo from '../../../ui/metafox-logo' diff --git a/ui/app/components/app/asset-list-item/asset-list-item.js b/ui/app/components/app/asset-list-item/asset-list-item.js index 4faafccc6..ad644f400 100644 --- a/ui/app/components/app/asset-list-item/asset-list-item.js +++ b/ui/app/components/app/asset-list-item/asset-list-item.js @@ -1,6 +1,8 @@ import React, { useMemo } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' +import { useDispatch } from 'react-redux' +import { useHistory } from 'react-router-dom' import Identicon from '../../ui/identicon' import ListItem from '../../ui/list-item' import Tooltip from '../../ui/tooltip' @@ -8,9 +10,7 @@ import InfoIcon from '../../ui/icon/info-icon.component' import Button from '../../ui/button' import { useI18nContext } from '../../../hooks/useI18nContext' import { useMetricEvent } from '../../../hooks/useMetricEvent' -import { useDispatch } from 'react-redux' import { updateSendToken } from '../../../store/actions' -import { useHistory } from 'react-router-dom' import { SEND_ROUTE } from '../../../helpers/constants/routes' diff --git a/ui/app/components/app/confirm-page-container/confirm-detail-row/tests/confirm-detail-row.component.test.js b/ui/app/components/app/confirm-page-container/confirm-detail-row/tests/confirm-detail-row.component.test.js index 32e7a2c1d..d431033c3 100644 --- a/ui/app/components/app/confirm-page-container/confirm-detail-row/tests/confirm-detail-row.component.test.js +++ b/ui/app/components/app/confirm-page-container/confirm-detail-row/tests/confirm-detail-row.component.test.js @@ -1,8 +1,8 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' -import ConfirmDetailRow from '../confirm-detail-row.component' import sinon from 'sinon' +import ConfirmDetailRow from '../confirm-detail-row.component' const propsMethodSpies = { onHeaderClick: sinon.spy(), diff --git a/ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js b/ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js index 0143df6d1..7b88c14d6 100644 --- a/ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js +++ b/ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js @@ -2,9 +2,9 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' import { Tabs, Tab } from '../../../ui/tabs' -import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.' import ErrorMessage from '../../../ui/error-message' import { PageContainerFooter } from '../../../ui/page-container' +import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.' export default class ConfirmPageContainerContent extends Component { diff --git a/ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js b/ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js index 5509e9cd4..854539477 100644 --- a/ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js +++ b/ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js @@ -1,8 +1,8 @@ import PropTypes from 'prop-types' import React, { PureComponent } from 'react' +import { MenuItem } from '../../ui/menu' import ConnectedAccountsListItem from './connected-accounts-list-item' import ConnectedAccountsListOptions from './connected-accounts-list-options' -import { MenuItem } from '../../ui/menu' export default class ConnectedAccountsList extends PureComponent { static contextTypes = { diff --git a/ui/app/components/app/connected-status-indicator/connected-status-indicator.container.js b/ui/app/components/app/connected-status-indicator/connected-status-indicator.container.js index 9cdaea0fa..678e5175e 100644 --- a/ui/app/components/app/connected-status-indicator/connected-status-indicator.container.js +++ b/ui/app/components/app/connected-status-indicator/connected-status-indicator.container.js @@ -1,6 +1,5 @@ import { findKey } from 'lodash' import { connect } from 'react-redux' -import ConnectedStatusIndicator from './connected-status-indicator.component' import { STATUS_CONNECTED, STATUS_CONNECTED_TO_ANOTHER_ACCOUNT, @@ -11,6 +10,7 @@ import { getOriginOfCurrentTab, getSelectedAddress, } from '../../../selectors' +import ConnectedStatusIndicator from './connected-status-indicator.component' const mapStateToProps = (state) => { diff --git a/ui/app/components/app/contact-list/recipient-group/recipient-group.component.js b/ui/app/components/app/contact-list/recipient-group/recipient-group.component.js index 34f3decd5..9614b16a9 100644 --- a/ui/app/components/app/contact-list/recipient-group/recipient-group.component.js +++ b/ui/app/components/app/contact-list/recipient-group/recipient-group.component.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' -import Identicon from '../../../ui/identicon' import classnames from 'classnames' +import Identicon from '../../../ui/identicon' import { ellipsify } from '../../../../pages/send/send.utils' function addressesEqual (address1, address2) { diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index e578a8b75..223c7d566 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -4,9 +4,9 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'redux' import * as actions from '../../../store/actions' +import { NETWORKS_ROUTE } from '../../../helpers/constants/routes' import { Dropdown, DropdownMenuItem } from './components/dropdown' import NetworkDropdownIcon from './components/network-dropdown-icon' -import { NETWORKS_ROUTE } from '../../../helpers/constants/routes' // classes from nodes of the toggle element. const notToggleElementClassnames = [ diff --git a/ui/app/components/app/dropdowns/tests/dropdown.test.js b/ui/app/components/app/dropdowns/tests/dropdown.test.js index 3cb5c6005..20d736800 100644 --- a/ui/app/components/app/dropdowns/tests/dropdown.test.js +++ b/ui/app/components/app/dropdowns/tests/dropdown.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { shallow } from 'enzyme' import { DropdownMenuItem } from '../components/dropdown' diff --git a/ui/app/components/app/dropdowns/tests/network-dropdown-icon.test.js b/ui/app/components/app/dropdowns/tests/network-dropdown-icon.test.js index 2d1ad59b0..370ed334f 100644 --- a/ui/app/components/app/dropdowns/tests/network-dropdown-icon.test.js +++ b/ui/app/components/app/dropdowns/tests/network-dropdown-icon.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import NetworkDropdownIcon from '../components/network-dropdown-icon' diff --git a/ui/app/components/app/dropdowns/tests/network-dropdown.test.js b/ui/app/components/app/dropdowns/tests/network-dropdown.test.js index 04005f19b..5aa458ddb 100644 --- a/ui/app/components/app/dropdowns/tests/network-dropdown.test.js +++ b/ui/app/components/app/dropdowns/tests/network-dropdown.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import configureMockStore from 'redux-mock-store' import thunk from 'redux-thunk' import { mountWithRouter } from '../../../../../../test/lib/render-helpers' diff --git a/ui/app/components/app/gas-customization/advanced-gas-inputs/tests/advanced-gas-input-component.test.js b/ui/app/components/app/gas-customization/advanced-gas-inputs/tests/advanced-gas-input-component.test.js index 3bf49aca1..8130a5179 100644 --- a/ui/app/components/app/gas-customization/advanced-gas-inputs/tests/advanced-gas-input-component.test.js +++ b/ui/app/components/app/gas-customization/advanced-gas-inputs/tests/advanced-gas-input-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import AdvancedTabContent from '../index' diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js index caa4d1abc..4668ced0b 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js @@ -1,7 +1,7 @@ -import React from 'react' import assert from 'assert' -import shallow from '../../../../../../../lib/shallow-with-context' +import React from 'react' import sinon from 'sinon' +import shallow from '../../../../../../../lib/shallow-with-context' import AdvancedTabContent from '../advanced-tab-content.component' import GasPriceChart from '../../../gas-price-chart' diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js index 2e2e8dab5..f8cec8a0c 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import shallow from '../../../../../../../lib/shallow-with-context' import BasicTabContent from '../basic-tab-content.component' import GasPriceButtonGroup from '../../../gas-price-button-group' diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js index 3d2b27f75..4babca855 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' -import GasModalPageContainer from './gas-modal-page-container.component' import { captureException } from '@sentry/browser' +import { addHexPrefix } from 'ethereumjs-util' import { hideModal, setGasLimit, @@ -63,8 +63,8 @@ import { calcGasTotal, isBalanceSufficient, } 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 GasModalPageContainer from './gas-modal-page-container.component' const mapStateToProps = (state, ownProps) => { const { currentNetworkTxList, send } = state.metamask diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js index 8557fb2ec..9c8b399fe 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js @@ -1,7 +1,7 @@ -import React from 'react' import assert from 'assert' -import shallow from '../../../../../../lib/shallow-with-context' +import React from 'react' import sinon from 'sinon' +import shallow from '../../../../../../lib/shallow-with-context' import GasModalPageContainer from '../gas-modal-page-container.component' import timeout from '../../../../../../lib/test-timeout' diff --git a/ui/app/components/app/gas-customization/gas-price-button-group/tests/gas-price-button-group-component.test.js b/ui/app/components/app/gas-customization/gas-price-button-group/tests/gas-price-button-group-component.test.js index 0499f4005..24a89e165 100644 --- a/ui/app/components/app/gas-customization/gas-price-button-group/tests/gas-price-button-group-component.test.js +++ b/ui/app/components/app/gas-customization/gas-price-button-group/tests/gas-price-button-group-component.test.js @@ -1,7 +1,7 @@ -import React from 'react' import assert from 'assert' -import shallow from '../../../../../../lib/shallow-with-context' +import React from 'react' import sinon from 'sinon' +import shallow from '../../../../../../lib/shallow-with-context' import GasPriceButtonGroup from '../gas-price-button-group.component' import ButtonGroup from '../../../../ui/button-group' diff --git a/ui/app/components/app/gas-customization/gas-price-chart/tests/gas-price-chart.component.test.js b/ui/app/components/app/gas-customization/gas-price-chart/tests/gas-price-chart.component.test.js index ecb5bafa7..df8a58b55 100644 --- a/ui/app/components/app/gas-customization/gas-price-chart/tests/gas-price-chart.component.test.js +++ b/ui/app/components/app/gas-customization/gas-price-chart/tests/gas-price-chart.component.test.js @@ -1,9 +1,9 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import proxyquire from 'proxyquire' import sinon from 'sinon' -import shallow from '../../../../../../lib/shallow-with-context' import * as d3 from 'd3' +import shallow from '../../../../../../lib/shallow-with-context' function timeout (time) { return new Promise((resolve) => { diff --git a/ui/app/components/app/info-box/tests/info-box.test.js b/ui/app/components/app/info-box/tests/info-box.test.js index e04d4ca67..6112a25ad 100644 --- a/ui/app/components/app/info-box/tests/info-box.test.js +++ b/ui/app/components/app/info-box/tests/info-box.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { shallow } from 'enzyme' diff --git a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js index 2b5456e4d..9c348dab7 100644 --- a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js +++ b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' -import LoadingNetworkScreen from './loading-network-screen.component' import * as actions from '../../../store/actions' import { getNetworkIdentifier } from '../../../selectors' +import LoadingNetworkScreen from './loading-network-screen.component' const mapStateToProps = (state) => { const { diff --git a/ui/app/components/app/menu-bar/menu-bar.js b/ui/app/components/app/menu-bar/menu-bar.js index 282307f59..8c4f5c8b9 100644 --- a/ui/app/components/app/menu-bar/menu-bar.js +++ b/ui/app/components/app/menu-bar/menu-bar.js @@ -4,13 +4,13 @@ import { useHistory } from 'react-router-dom' import { useSelector } from 'react-redux' import SelectedAccount from '../selected-account' import ConnectedStatusIndicator from '../connected-status-indicator' -import AccountOptionsMenu from './account-options-menu' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' import { CONNECTED_ACCOUNTS_ROUTE } from '../../../helpers/constants/routes' import { useI18nContext } from '../../../hooks/useI18nContext' import { useMetricEvent } from '../../../hooks/useMetricEvent' import { getOriginOfCurrentTab } from '../../../selectors' +import AccountOptionsMenu from './account-options-menu' export default function MenuBar () { const t = useI18nContext() diff --git a/ui/app/components/app/menu-bar/tests/menu-bar.test.js b/ui/app/components/app/menu-bar/tests/menu-bar.test.js index e48b23ae6..416179d17 100644 --- a/ui/app/components/app/menu-bar/tests/menu-bar.test.js +++ b/ui/app/components/app/menu-bar/tests/menu-bar.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { Provider } from 'react-redux' import configureStore from 'redux-mock-store' import { mountWithRouter } from '../../../../../../test/lib/render-helpers' diff --git a/ui/app/components/app/modal/modal-content/tests/modal-content.component.test.js b/ui/app/components/app/modal/modal-content/tests/modal-content.component.test.js index 468775797..058727cc2 100644 --- a/ui/app/components/app/modal/modal-content/tests/modal-content.component.test.js +++ b/ui/app/components/app/modal/modal-content/tests/modal-content.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import ModalContent from '../modal-content.component' diff --git a/ui/app/components/app/modal/modal.component.js b/ui/app/components/app/modal/modal.component.js index 41e4ea694..5e2ad00f5 100644 --- a/ui/app/components/app/modal/modal.component.js +++ b/ui/app/components/app/modal/modal.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import Button from '../../ui/button' import classnames from 'classnames' +import Button from '../../ui/button' export default class Modal extends PureComponent { static propTypes = { diff --git a/ui/app/components/app/modal/tests/modal.component.test.js b/ui/app/components/app/modal/tests/modal.component.test.js index dbb615233..5dceb4292 100644 --- a/ui/app/components/app/modal/tests/modal.component.test.js +++ b/ui/app/components/app/modal/tests/modal.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { mount, shallow } from 'enzyme' import sinon from 'sinon' import Modal from '../modal.component' diff --git a/ui/app/components/app/modals/account-modal-container/account-modal-container.component.js b/ui/app/components/app/modals/account-modal-container/account-modal-container.component.js index fb8cee58c..93f4ae25b 100644 --- a/ui/app/components/app/modals/account-modal-container/account-modal-container.component.js +++ b/ui/app/components/app/modals/account-modal-container/account-modal-container.component.js @@ -1,7 +1,7 @@ import PropTypes from 'prop-types' import React from 'react' -import Identicon from '../../../ui/identicon' import classnames from 'classnames' +import Identicon from '../../../ui/identicon' export default function AccountModalContainer (props, context) { const { diff --git a/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js b/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js index ff3a6ad12..176ac86bc 100644 --- a/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js +++ b/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' -import AddToAddressBookModal from './add-to-addressbook-modal.component' import * as actions from '../../../../store/actions' +import AddToAddressBookModal from './add-to-addressbook-modal.component' function mapStateToProps (state) { return { diff --git a/ui/app/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/tests/cancel-transaction-gas-fee.component.test.js b/ui/app/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/tests/cancel-transaction-gas-fee.component.test.js index ee9bf1d1c..339d34544 100644 --- a/ui/app/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/tests/cancel-transaction-gas-fee.component.test.js +++ b/ui/app/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/tests/cancel-transaction-gas-fee.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import CancelTransactionGasFee from '../cancel-transaction-gas-fee.component' import UserPreferencedCurrencyDisplay from '../../../../user-preferenced-currency-display' diff --git a/ui/app/components/app/modals/cancel-transaction/cancel-transaction.component.js b/ui/app/components/app/modals/cancel-transaction/cancel-transaction.component.js index 6bab5ec1f..2d01711ff 100644 --- a/ui/app/components/app/modals/cancel-transaction/cancel-transaction.component.js +++ b/ui/app/components/app/modals/cancel-transaction/cancel-transaction.component.js @@ -1,8 +1,8 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import Modal from '../../modal' -import CancelTransactionGasFee from './cancel-transaction-gas-fee' import { SUBMITTED_STATUS } from '../../../../helpers/constants/transactions' +import CancelTransactionGasFee from './cancel-transaction-gas-fee' export default class CancelTransaction extends PureComponent { static contextTypes = { diff --git a/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js b/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js index 4e7a8d644..9645a5df1 100644 --- a/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js +++ b/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js @@ -3,9 +3,9 @@ import { compose } from 'redux' import ethUtil from 'ethereumjs-util' import { multiplyCurrencies } from '../../../../helpers/utils/conversion-util' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' -import CancelTransaction from './cancel-transaction.component' import { showModal, createCancelTransaction } from '../../../../store/actions' import { getHexGasTotal } from '../../../../helpers/utils/confirm-tx.util' +import CancelTransaction from './cancel-transaction.component' const mapStateToProps = (state, ownProps) => { const { metamask } = state diff --git a/ui/app/components/app/modals/cancel-transaction/tests/cancel-transaction.component.test.js b/ui/app/components/app/modals/cancel-transaction/tests/cancel-transaction.component.test.js index 3ccf6bda0..aaa87c21b 100644 --- a/ui/app/components/app/modals/cancel-transaction/tests/cancel-transaction.component.test.js +++ b/ui/app/components/app/modals/cancel-transaction/tests/cancel-transaction.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import CancelTransaction from '../cancel-transaction.component' diff --git a/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js b/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js index ca8011d0d..b6a5c99f5 100644 --- a/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js +++ b/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { compose } from 'redux' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' -import ConfirmDeleteNetwork from './confirm-delete-network.component' import { delRpcTarget } from '../../../../store/actions' +import ConfirmDeleteNetwork from './confirm-delete-network.component' const mapDispatchToProps = (dispatch) => { return { diff --git a/ui/app/components/app/modals/confirm-delete-network/tests/confirm-delete-network.test.js b/ui/app/components/app/modals/confirm-delete-network/tests/confirm-delete-network.test.js index f4f85d589..e5c2ceeb5 100644 --- a/ui/app/components/app/modals/confirm-delete-network/tests/confirm-delete-network.test.js +++ b/ui/app/components/app/modals/confirm-delete-network/tests/confirm-delete-network.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import ConfirmDeleteNetwork from '../index' diff --git a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js index 805b9c3e9..c3b54577c 100644 --- a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js +++ b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { compose } from 'redux' -import ConfirmRemoveAccount from './confirm-remove-account.component' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import { removeAccount } from '../../../../store/actions' +import ConfirmRemoveAccount from './confirm-remove-account.component' const mapStateToProps = (state) => { return { diff --git a/ui/app/components/app/modals/confirm-remove-account/tests/confirm-remove-account.test.js b/ui/app/components/app/modals/confirm-remove-account/tests/confirm-remove-account.test.js index c380e06da..6aa26ba70 100644 --- a/ui/app/components/app/modals/confirm-remove-account/tests/confirm-remove-account.test.js +++ b/ui/app/components/app/modals/confirm-remove-account/tests/confirm-remove-account.test.js @@ -1,7 +1,7 @@ +import assert from 'assert' import React from 'react' import PropTypes from 'prop-types' import { Provider } from 'react-redux' -import assert from 'assert' import sinon from 'sinon' import configureStore from 'redux-mock-store' import { mount } from 'enzyme' diff --git a/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js b/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js index 6ef230f41..fcbcb9c7a 100644 --- a/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js +++ b/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { compose } from 'redux' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' -import ConfirmResetAccount from './confirm-reset-account.component' import { resetAccount } from '../../../../store/actions' +import ConfirmResetAccount from './confirm-reset-account.component' const mapDispatchToProps = (dispatch) => { return { diff --git a/ui/app/components/app/modals/confirm-reset-account/tests/confirm-reset-account.test.js b/ui/app/components/app/modals/confirm-reset-account/tests/confirm-reset-account.test.js index be27151f1..d9e05c6a7 100644 --- a/ui/app/components/app/modals/confirm-reset-account/tests/confirm-reset-account.test.js +++ b/ui/app/components/app/modals/confirm-reset-account/tests/confirm-reset-account.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import ConfirmResetAccount from '../index' diff --git a/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.component.js b/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.component.js index fca21145a..9354dad2c 100644 --- a/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.component.js +++ b/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.component.js @@ -1,12 +1,12 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import log from 'loglevel' +import classnames from 'classnames' +import BigNumber from 'bignumber.js' import Modal from '../../modal' import Identicon from '../../../ui/identicon' import TextField from '../../../ui/text-field' 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) diff --git a/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.container.js b/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.container.js index 357d70ef2..671d99cf6 100644 --- a/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.container.js +++ b/ui/app/components/app/modals/edit-approval-permission/edit-approval-permission.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { compose } from 'redux' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' -import EditApprovalPermission from './edit-approval-permission.component' import { getSelectedIdentity } from '../../../../selectors' +import EditApprovalPermission from './edit-approval-permission.component' const mapStateToProps = (state) => { const modalStateProps = state.appState.modal.modalState.props || {} diff --git a/ui/app/components/app/modals/loading-network-error/loading-network-error.container.js b/ui/app/components/app/modals/loading-network-error/loading-network-error.container.js index 38ea9b2ab..765cdf9c5 100644 --- a/ui/app/components/app/modals/loading-network-error/loading-network-error.container.js +++ b/ui/app/components/app/modals/loading-network-error/loading-network-error.container.js @@ -1,4 +1,4 @@ -import LoadingNetworkError from './loading-network-error.component' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' +import LoadingNetworkError from './loading-network-error.component' export default withModalProps(LoadingNetworkError) diff --git a/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js b/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js index c3e6fd8b3..8cef4a076 100644 --- a/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js +++ b/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { compose } from 'redux' -import MetaMetricsOptInModal from './metametrics-opt-in-modal.component' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import { setParticipateInMetaMetrics } from '../../../../store/actions' +import MetaMetricsOptInModal from './metametrics-opt-in-modal.component' const mapStateToProps = (_, ownProps) => { const { unapprovedTxCount } = ownProps diff --git a/ui/app/components/app/modals/metametrics-opt-in-modal/tests/metametrics-opt-in-modal.test.js b/ui/app/components/app/modals/metametrics-opt-in-modal/tests/metametrics-opt-in-modal.test.js index 0d2787ebc..e35549cbe 100644 --- a/ui/app/components/app/modals/metametrics-opt-in-modal/tests/metametrics-opt-in-modal.test.js +++ b/ui/app/components/app/modals/metametrics-opt-in-modal/tests/metametrics-opt-in-modal.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import MetaMetricsOptIn from '../index' diff --git a/ui/app/components/app/modals/modal.js b/ui/app/components/app/modals/modal.js index 812090f10..d8e6ef214 100644 --- a/ui/app/components/app/modals/modal.js +++ b/ui/app/components/app/modals/modal.js @@ -9,6 +9,7 @@ import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' // Modal Components +import ConfirmCustomizeGasModal from '../gas-customization/gas-modal-page-container' import DepositEtherModal from './deposit-ether-modal' import AccountDetailsModal from './account-details-modal' import ExportPrivateKeyModal from './export-private-key-modal' @@ -24,7 +25,6 @@ import CancelTransaction from './cancel-transaction' import FadeModal from './fade-modal' import MetaMetricsOptInModal from './metametrics-opt-in-modal' import RejectTransactions from './reject-transactions' -import ConfirmCustomizeGasModal from '../gas-customization/gas-modal-page-container' import ConfirmDeleteNetwork from './confirm-delete-network' import AddToAddressBookModal from './add-to-addressbook-modal' import EditApprovalPermission from './edit-approval-permission' diff --git a/ui/app/components/app/modals/new-account-modal/new-account-modal.container.js b/ui/app/components/app/modals/new-account-modal/new-account-modal.container.js index adda14d37..c787af9a0 100644 --- a/ui/app/components/app/modals/new-account-modal/new-account-modal.container.js +++ b/ui/app/components/app/modals/new-account-modal/new-account-modal.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' -import NewAccountModal from './new-account-modal.component' import * as actions from '../../../../store/actions' +import NewAccountModal from './new-account-modal.component' function mapStateToProps (state) { return { diff --git a/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js b/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js index b7fce7523..fca9d61ad 100644 --- a/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js +++ b/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' +import { hideModal, qrCodeDetected } from '../../../../store/actions' import QrScanner from './qr-scanner.component' -import { hideModal, qrCodeDetected } from '../../../../store/actions' const mapDispatchToProps = (dispatch) => { return { diff --git a/ui/app/components/app/modals/reject-transactions/reject-transactions.container.js b/ui/app/components/app/modals/reject-transactions/reject-transactions.container.js index 72eddbc8b..08061a48d 100644 --- a/ui/app/components/app/modals/reject-transactions/reject-transactions.container.js +++ b/ui/app/components/app/modals/reject-transactions/reject-transactions.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import { compose } from 'redux' -import RejectTransactionsModal from './reject-transactions.component' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' +import RejectTransactionsModal from './reject-transactions.component' const mapStateToProps = (_, ownProps) => { const { unapprovedTxCount } = ownProps diff --git a/ui/app/components/app/modals/reject-transactions/tests/reject-transactions.test.js b/ui/app/components/app/modals/reject-transactions/tests/reject-transactions.test.js index d7623604e..93f4495da 100644 --- a/ui/app/components/app/modals/reject-transactions/tests/reject-transactions.test.js +++ b/ui/app/components/app/modals/reject-transactions/tests/reject-transactions.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import RejectTransactionsModal from '../index' diff --git a/ui/app/components/app/modals/tests/account-details-modal.test.js b/ui/app/components/app/modals/tests/account-details-modal.test.js index 505b823cd..cc2dabdf2 100644 --- a/ui/app/components/app/modals/tests/account-details-modal.test.js +++ b/ui/app/components/app/modals/tests/account-details-modal.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { shallow } from 'enzyme' import AccountDetailsModal from '../account-details-modal' diff --git a/ui/app/components/app/modals/transaction-confirmed/tests/transaction-confirmed.test.js b/ui/app/components/app/modals/transaction-confirmed/tests/transaction-confirmed.test.js index 47b653dd7..ad8ba565d 100644 --- a/ui/app/components/app/modals/transaction-confirmed/tests/transaction-confirmed.test.js +++ b/ui/app/components/app/modals/transaction-confirmed/tests/transaction-confirmed.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import TransactionConfirmed from '../index' diff --git a/ui/app/components/app/modals/transaction-confirmed/transaction-confirmed.container.js b/ui/app/components/app/modals/transaction-confirmed/transaction-confirmed.container.js index 9089ec158..3109c5e27 100644 --- a/ui/app/components/app/modals/transaction-confirmed/transaction-confirmed.container.js +++ b/ui/app/components/app/modals/transaction-confirmed/transaction-confirmed.container.js @@ -1,4 +1,4 @@ -import TransactionConfirmed from './transaction-confirmed.component' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' +import TransactionConfirmed from './transaction-confirmed.component' export default withModalProps(TransactionConfirmed) diff --git a/ui/app/components/app/permission-page-container/permission-page-container.component.js b/ui/app/components/app/permission-page-container/permission-page-container.component.js index f61c9c0ab..8598ab976 100644 --- a/ui/app/components/app/permission-page-container/permission-page-container.component.js +++ b/ui/app/components/app/permission-page-container/permission-page-container.component.js @@ -1,9 +1,9 @@ import PropTypes from 'prop-types' import React, { Component } from 'react' import { isEqual } from 'lodash' -import { PermissionPageContainerContent } from '.' import { PageContainerFooter } from '../../ui/page-container' import PermissionsConnectFooter from '../permissions-connect-footer' +import { PermissionPageContainerContent } from '.' export default class PermissionPageContainer extends Component { diff --git a/ui/app/components/app/permission-page-container/permission-page-container.container.js b/ui/app/components/app/permission-page-container/permission-page-container.container.js index 4a2b7c660..bae0f43d9 100644 --- a/ui/app/components/app/permission-page-container/permission-page-container.container.js +++ b/ui/app/components/app/permission-page-container/permission-page-container.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' -import PermissionPageContainer from './permission-page-container.component' import { getMetaMaskIdentities } from '../../../selectors' +import PermissionPageContainer from './permission-page-container.component' const mapStateToProps = (state, ownProps) => { const { selectedIdentities } = ownProps diff --git a/ui/app/components/app/selected-account/selected-account.container.js b/ui/app/components/app/selected-account/selected-account.container.js index 57a91cd10..22e6cc5ef 100644 --- a/ui/app/components/app/selected-account/selected-account.container.js +++ b/ui/app/components/app/selected-account/selected-account.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' +import { getSelectedIdentity } from '../../../selectors' import SelectedAccount from './selected-account.component' -import { getSelectedIdentity } from '../../../selectors' const mapStateToProps = (state) => { return { diff --git a/ui/app/components/app/selected-account/tests/selected-account-component.test.js b/ui/app/components/app/selected-account/tests/selected-account-component.test.js index 323ead37b..943ccf00a 100644 --- a/ui/app/components/app/selected-account/tests/selected-account-component.test.js +++ b/ui/app/components/app/selected-account/tests/selected-account-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { render } from 'enzyme' import SelectedAccount from '../selected-account.component' diff --git a/ui/app/components/app/sidebars/tests/sidebars-component.test.js b/ui/app/components/app/sidebars/tests/sidebars-component.test.js index ba92c72a5..ea9958775 100644 --- a/ui/app/components/app/sidebars/tests/sidebars-component.test.js +++ b/ui/app/components/app/sidebars/tests/sidebars-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import ReactCSSTransitionGroup from 'react-transition-group/CSSTransitionGroup' diff --git a/ui/app/components/app/signature-request-original/signature-request-original.container.js b/ui/app/components/app/signature-request-original/signature-request-original.container.js index 63150d38d..8d0a397ef 100644 --- a/ui/app/components/app/signature-request-original/signature-request-original.container.js +++ b/ui/app/components/app/signature-request-original/signature-request-original.container.js @@ -10,8 +10,8 @@ import { } from '../../../selectors' import { getAccountByAddress } from '../../../helpers/utils/util' import { clearConfirmTransaction } from '../../../ducks/confirm-transaction/confirm-transaction.duck' -import SignatureRequestOriginal from './signature-request-original.component' import { getMostRecentOverviewPage } from '../../../ducks/history/history' +import SignatureRequestOriginal from './signature-request-original.component' function mapStateToProps (state) { return { diff --git a/ui/app/components/app/signature-request/signature-request.component.js b/ui/app/components/app/signature-request/signature-request.component.js index a6cbbdbc8..d3a42107c 100644 --- a/ui/app/components/app/signature-request/signature-request.component.js +++ b/ui/app/components/app/signature-request/signature-request.component.js @@ -1,11 +1,11 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' +import { getEnvironmentType } from '../../../../../app/scripts/lib/util' +import Identicon from '../../ui/identicon' import Header from './signature-request-header' import Footer from './signature-request-footer' import Message from './signature-request-message' import { ENVIRONMENT_TYPE_NOTIFICATION } from './signature-request.constants' -import { getEnvironmentType } from '../../../../../app/scripts/lib/util' -import Identicon from '../../ui/identicon' export default class SignatureRequest extends PureComponent { static propTypes = { diff --git a/ui/app/components/app/signature-request/signature-request.container.js b/ui/app/components/app/signature-request/signature-request.container.js index 10976e66b..939741904 100644 --- a/ui/app/components/app/signature-request/signature-request.container.js +++ b/ui/app/components/app/signature-request/signature-request.container.js @@ -1,11 +1,11 @@ import { connect } from 'react-redux' -import SignatureRequest from './signature-request.component' import { clearConfirmTransaction } from '../../../ducks/confirm-transaction/confirm-transaction.duck' import { accountsWithSendEtherInfoSelector, } from '../../../selectors' import { getAccountByAddress } from '../../../helpers/utils/util' import { MESSAGE_TYPE } from '../../../../../app/scripts/lib/enums' +import SignatureRequest from './signature-request.component' function mapStateToProps (state) { return { diff --git a/ui/app/components/app/signature-request/tests/signature-request.test.js b/ui/app/components/app/signature-request/tests/signature-request.test.js index 8956a957d..ec1ecfd69 100644 --- a/ui/app/components/app/signature-request/tests/signature-request.test.js +++ b/ui/app/components/app/signature-request/tests/signature-request.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import shallow from '../../../../../lib/shallow-with-context' import SignatureRequest from '../signature-request.component' diff --git a/ui/app/components/app/tests/signature-request.test.js b/ui/app/components/app/tests/signature-request.test.js index 21612e5a0..9efd70973 100644 --- a/ui/app/components/app/tests/signature-request.test.js +++ b/ui/app/components/app/tests/signature-request.test.js @@ -1,6 +1,6 @@ +import assert from 'assert' import React from 'react' import { Provider } from 'react-redux' -import assert from 'assert' import sinon from 'sinon' import configureMockStore from 'redux-mock-store' import { mountWithRouter } from '../../../../../test/lib/render-helpers' diff --git a/ui/app/components/app/token-cell/token-cell.js b/ui/app/components/app/token-cell/token-cell.js index e5f6a5d55..89843b850 100644 --- a/ui/app/components/app/token-cell/token-cell.js +++ b/ui/app/components/app/token-cell/token-cell.js @@ -1,8 +1,8 @@ import classnames from 'classnames' import PropTypes from 'prop-types' import React from 'react' -import AssetListItem from '../asset-list-item' import { useSelector } from 'react-redux' +import AssetListItem from '../asset-list-item' import { getSelectedAddress } from '../../../selectors' import { useI18nContext } from '../../../hooks/useI18nContext' import { useTokenFiatAmount } from '../../../hooks/useTokenFiatAmount' diff --git a/ui/app/components/app/token-cell/token-cell.test.js b/ui/app/components/app/token-cell/token-cell.test.js index b01f581cf..65a238b69 100644 --- a/ui/app/components/app/token-cell/token-cell.test.js +++ b/ui/app/components/app/token-cell/token-cell.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import thunk from 'redux-thunk' import { Provider } from 'react-redux' import configureMockStore from 'redux-mock-store' @@ -7,8 +7,8 @@ import { mount } from 'enzyme' import sinon from 'sinon' import { MemoryRouter } from 'react-router-dom' -import TokenCell from '.' import Identicon from '../../ui/identicon' +import TokenCell from '.' describe('Token Cell', function () { let wrapper diff --git a/ui/app/components/app/token-list/token-list.js b/ui/app/components/app/token-list/token-list.js index 591dbe33a..b71e6930b 100644 --- a/ui/app/components/app/token-list/token-list.js +++ b/ui/app/components/app/token-list/token-list.js @@ -2,10 +2,10 @@ import React from 'react' import PropTypes from 'prop-types' import { isEqual } from 'lodash' +import { useSelector } from 'react-redux' import TokenCell from '../token-cell' import { useI18nContext } from '../../../hooks/useI18nContext' import { useTokenTracker } from '../../../hooks/useTokenTracker' -import { useSelector } from 'react-redux' import { getAssetImages } from '../../../selectors' import { getTokens } from '../../../ducks/metamask/metamask' diff --git a/ui/app/components/app/transaction-action/tests/transaction-action.component.test.js b/ui/app/components/app/transaction-action/tests/transaction-action.component.test.js index 1d0263cb0..d51c7001d 100644 --- a/ui/app/components/app/transaction-action/tests/transaction-action.component.test.js +++ b/ui/app/components/app/transaction-action/tests/transaction-action.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import TransactionAction from '../transaction-action.component' diff --git a/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js b/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js index 99947104c..9b3c39792 100644 --- a/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js +++ b/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import TransactionActivityLog from '../transaction-activity-log.component' diff --git a/ui/app/components/app/transaction-activity-log/transaction-activity-log.component.js b/ui/app/components/app/transaction-activity-log/transaction-activity-log.component.js index 865320a45..9d071b432 100644 --- a/ui/app/components/app/transaction-activity-log/transaction-activity-log.component.js +++ b/ui/app/components/app/transaction-activity-log/transaction-activity-log.component.js @@ -3,9 +3,9 @@ import PropTypes from 'prop-types' import classnames from 'classnames' import { getEthConversionFromWeiHex, getValueFromWeiHex } from '../../../helpers/utils/conversions.util' import { formatDate } from '../../../helpers/utils/util' +import { getEtherscanNetworkPrefix } from '../../../../lib/etherscan-prefix-for-network' import TransactionActivityLogIcon from './transaction-activity-log-icon' import { CONFIRMED_STATUS } from './transaction-activity-log.constants' -import { getEtherscanNetworkPrefix } from '../../../../lib/etherscan-prefix-for-network' export default class TransactionActivityLog extends PureComponent { static contextTypes = { diff --git a/ui/app/components/app/transaction-activity-log/transaction-activity-log.container.js b/ui/app/components/app/transaction-activity-log/transaction-activity-log.container.js index 7e01e8745..df7a3dc20 100644 --- a/ui/app/components/app/transaction-activity-log/transaction-activity-log.container.js +++ b/ui/app/components/app/transaction-activity-log/transaction-activity-log.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import { findLastIndex } from 'lodash' -import TransactionActivityLog from './transaction-activity-log.component' import { conversionRateSelector, getNativeCurrency } from '../../../selectors' +import TransactionActivityLog from './transaction-activity-log.component' import { combineTransactionHistories } from './transaction-activity-log.util' import { TRANSACTION_RESUBMITTED_EVENT, diff --git a/ui/app/components/app/transaction-activity-log/transaction-activity-log.util.js b/ui/app/components/app/transaction-activity-log/transaction-activity-log.util.js index b01c66145..ba45b9be0 100644 --- a/ui/app/components/app/transaction-activity-log/transaction-activity-log.util.js +++ b/ui/app/components/app/transaction-activity-log/transaction-activity-log.util.js @@ -8,6 +8,10 @@ const GAS_LIMIT_PATH = '/txParams/gas' // op constants const REPLACE_OP = 'replace' +import { + TRANSACTION_TYPE_CANCEL, + TRANSACTION_TYPE_RETRY, +} from '../../../../../app/scripts/controllers/transactions/enums' import { // event constants TRANSACTION_CREATED_EVENT, @@ -25,10 +29,6 @@ import { DROPPED_STATUS, } from './transaction-activity-log.constants' -import { - TRANSACTION_TYPE_CANCEL, - TRANSACTION_TYPE_RETRY, -} from '../../../../../app/scripts/controllers/transactions/enums' const eventPathsHash = { [STATUS_PATH]: true, diff --git a/ui/app/components/app/transaction-breakdown/tests/transaction-breakdown.component.test.js b/ui/app/components/app/transaction-breakdown/tests/transaction-breakdown.component.test.js index bd4c3332a..608ba34b9 100644 --- a/ui/app/components/app/transaction-breakdown/tests/transaction-breakdown.component.test.js +++ b/ui/app/components/app/transaction-breakdown/tests/transaction-breakdown.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import TransactionBreakdown from '../transaction-breakdown.component' diff --git a/ui/app/components/app/transaction-breakdown/transaction-breakdown-row/tests/transaction-breakdown-row.component.test.js b/ui/app/components/app/transaction-breakdown/transaction-breakdown-row/tests/transaction-breakdown-row.component.test.js index 752d8b6af..f25773e58 100644 --- a/ui/app/components/app/transaction-breakdown/transaction-breakdown-row/tests/transaction-breakdown-row.component.test.js +++ b/ui/app/components/app/transaction-breakdown/transaction-breakdown-row/tests/transaction-breakdown-row.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import TransactionBreakdownRow from '../transaction-breakdown-row.component' import Button from '../../../../ui/button' diff --git a/ui/app/components/app/transaction-breakdown/transaction-breakdown.component.js b/ui/app/components/app/transaction-breakdown/transaction-breakdown.component.js index a534ae1a6..7e99f02c3 100644 --- a/ui/app/components/app/transaction-breakdown/transaction-breakdown.component.js +++ b/ui/app/components/app/transaction-breakdown/transaction-breakdown.component.js @@ -1,11 +1,11 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' -import TransactionBreakdownRow from './transaction-breakdown-row' import CurrencyDisplay from '../../ui/currency-display' import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display' import HexToDecimal from '../../ui/hex-to-decimal' import { GWEI, PRIMARY, SECONDARY } from '../../../helpers/constants/common' +import TransactionBreakdownRow from './transaction-breakdown-row' export default class TransactionBreakdown extends PureComponent { static contextTypes = { diff --git a/ui/app/components/app/transaction-breakdown/transaction-breakdown.container.js b/ui/app/components/app/transaction-breakdown/transaction-breakdown.container.js index bfc23913c..e52b0bce0 100644 --- a/ui/app/components/app/transaction-breakdown/transaction-breakdown.container.js +++ b/ui/app/components/app/transaction-breakdown/transaction-breakdown.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' -import TransactionBreakdown from './transaction-breakdown.component' import { getIsMainnet, getNativeCurrency, getPreferences } from '../../../selectors' import { getHexGasTotal } from '../../../helpers/utils/confirm-tx.util' import { sumHexes } from '../../../helpers/utils/transactions.util' +import TransactionBreakdown from './transaction-breakdown.component' const mapStateToProps = (state, ownProps) => { const { transaction } = ownProps diff --git a/ui/app/components/app/transaction-list-item-details/tests/transaction-list-item-details.component.test.js b/ui/app/components/app/transaction-list-item-details/tests/transaction-list-item-details.component.test.js index f0e3edf4d..d647362f5 100644 --- a/ui/app/components/app/transaction-list-item-details/tests/transaction-list-item-details.component.test.js +++ b/ui/app/components/app/transaction-list-item-details/tests/transaction-list-item-details.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import TransactionListItemDetails from '../transaction-list-item-details.component' import Button from '../../../ui/button' diff --git a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js index c9d48bf7e..6bea44d2a 100644 --- a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js +++ b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' -import TransactionListItemDetails from './transaction-list-item-details.component' import { checksumAddress } from '../../../helpers/utils/util' import { tryReverseResolveAddress } from '../../../store/actions' import { getAddressBook, getRpcPrefsForCurrentProvider } from '../../../selectors' +import TransactionListItemDetails from './transaction-list-item-details.component' const mapStateToProps = (state, ownProps) => { const { metamask } = state diff --git a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js index 784e49907..eb03d3003 100644 --- a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js +++ b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js @@ -1,6 +1,7 @@ import React, { useMemo, useState, useCallback } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' +import { useHistory } from 'react-router-dom' import ListItem from '../../ui/list-item' import { useTransactionDisplayData } from '../../../hooks/useTransactionDisplayData' import Preloader from '../../ui/icon/preloader' @@ -10,7 +11,6 @@ import { useRetryTransaction } from '../../../hooks/useRetryTransaction' import Button from '../../ui/button' import Tooltip from '../../ui/tooltip' import TransactionListItemDetails from '../transaction-list-item-details' -import { useHistory } from 'react-router-dom' import { CONFIRM_TRANSACTION_ROUTE } from '../../../helpers/constants/routes' import { TRANSACTION_CATEGORY_SIGNATURE_REQUEST, diff --git a/ui/app/components/app/transaction-status/tests/transaction-status.component.test.js b/ui/app/components/app/transaction-status/tests/transaction-status.component.test.js index 20100cc46..51d02b451 100644 --- a/ui/app/components/app/transaction-status/tests/transaction-status.component.test.js +++ b/ui/app/components/app/transaction-status/tests/transaction-status.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { mount } from 'enzyme' import sinon from 'sinon' import * as i18nHook from '../../../../hooks/useI18nContext' diff --git a/ui/app/components/app/user-preferenced-currency-display/tests/user-preferenced-currency-display.component.test.js b/ui/app/components/app/user-preferenced-currency-display/tests/user-preferenced-currency-display.component.test.js index c2619ad67..c5c903fd9 100644 --- a/ui/app/components/app/user-preferenced-currency-display/tests/user-preferenced-currency-display.component.test.js +++ b/ui/app/components/app/user-preferenced-currency-display/tests/user-preferenced-currency-display.component.test.js @@ -1,11 +1,11 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' +import sinon from 'sinon' import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display.component' import CurrencyDisplay from '../../../ui/currency-display' import * as currencyHook from '../../../../hooks/useCurrencyDisplay' import * as currencyPrefHook from '../../../../hooks/useUserPreferencedCurrency' -import sinon from 'sinon' describe('UserPreferencedCurrencyDisplay Component', function () { diff --git a/ui/app/components/app/user-preferenced-currency-input/tests/user-preferenced-currency-input.component.test.js b/ui/app/components/app/user-preferenced-currency-input/tests/user-preferenced-currency-input.component.test.js index 21105ef7e..3241008e4 100644 --- a/ui/app/components/app/user-preferenced-currency-input/tests/user-preferenced-currency-input.component.test.js +++ b/ui/app/components/app/user-preferenced-currency-input/tests/user-preferenced-currency-input.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import UserPreferencedCurrencyInput from '../user-preferenced-currency-input.component' import CurrencyInput from '../../../ui/currency-input' diff --git a/ui/app/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js b/ui/app/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js index 808f9340e..2cce58027 100644 --- a/ui/app/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js +++ b/ui/app/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' -import UserPreferencedCurrencyInput from './user-preferenced-currency-input.component' import { getPreferences } from '../../../selectors' +import UserPreferencedCurrencyInput from './user-preferenced-currency-input.component' const mapStateToProps = (state) => { const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(state) diff --git a/ui/app/components/app/user-preferenced-token-input/tests/user-preferenced-token-input.component.test.js b/ui/app/components/app/user-preferenced-token-input/tests/user-preferenced-token-input.component.test.js index e0a4f1ea2..ce882f6e5 100644 --- a/ui/app/components/app/user-preferenced-token-input/tests/user-preferenced-token-input.component.test.js +++ b/ui/app/components/app/user-preferenced-token-input/tests/user-preferenced-token-input.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import UserPreferencedTokenInput from '../user-preferenced-token-input.component' import TokenInput from '../../../ui/token-input' diff --git a/ui/app/components/app/user-preferenced-token-input/user-preferenced-token-input.container.js b/ui/app/components/app/user-preferenced-token-input/user-preferenced-token-input.container.js index 141ad24b2..daddded7f 100644 --- a/ui/app/components/app/user-preferenced-token-input/user-preferenced-token-input.container.js +++ b/ui/app/components/app/user-preferenced-token-input/user-preferenced-token-input.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import PropTypes from 'prop-types' -import UserPreferencedTokenInput from './user-preferenced-token-input.component' import { getPreferences } from '../../../selectors' +import UserPreferencedTokenInput from './user-preferenced-token-input.component' const mapStateToProps = (state) => { const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(state) diff --git a/ui/app/components/app/wallet-overview/eth-overview.js b/ui/app/components/app/wallet-overview/eth-overview.js index c90e599f5..a98904f24 100644 --- a/ui/app/components/app/wallet-overview/eth-overview.js +++ b/ui/app/components/app/wallet-overview/eth-overview.js @@ -7,7 +7,6 @@ import { useHistory } from 'react-router-dom' import Button from '../../ui/button' import Identicon from '../../ui/identicon' import { I18nContext } from '../../../contexts/i18n' -import WalletOverview from './wallet-overview' import { SEND_ROUTE } from '../../../helpers/constants/routes' import { useMetricEvent } from '../../../hooks/useMetricEvent' import Tooltip from '../../ui/tooltip' @@ -16,6 +15,7 @@ import { PRIMARY, SECONDARY } from '../../../helpers/constants/common' import { showModal } from '../../../store/actions' import { isBalanceCached, getSelectedAccount, getShouldShowFiat } from '../../../selectors/selectors' import PaperAirplane from '../../ui/icon/paper-airplane-icon' +import WalletOverview from './wallet-overview' const EthOverview = ({ className }) => { const dispatch = useDispatch() diff --git a/ui/app/components/app/wallet-overview/token-overview.js b/ui/app/components/app/wallet-overview/token-overview.js index e1e0df2b6..ea7e870f9 100644 --- a/ui/app/components/app/wallet-overview/token-overview.js +++ b/ui/app/components/app/wallet-overview/token-overview.js @@ -7,7 +7,6 @@ import Button from '../../ui/button' import Identicon from '../../ui/identicon' import CurrencyDisplay from '../../ui/currency-display' import { I18nContext } from '../../../contexts/i18n' -import WalletOverview from './wallet-overview' import { SEND_ROUTE } from '../../../helpers/constants/routes' import { useMetricEvent } from '../../../hooks/useMetricEvent' import { useTokenTracker } from '../../../hooks/useTokenTracker' @@ -15,6 +14,7 @@ import { useTokenFiatAmount } from '../../../hooks/useTokenFiatAmount' import { getAssetImages } from '../../../selectors/selectors' import { updateSendToken } from '../../../store/actions' import PaperAirplane from '../../ui/icon/paper-airplane-icon' +import WalletOverview from './wallet-overview' const TokenOverview = ({ className, token }) => { const dispatch = useDispatch() diff --git a/ui/app/components/ui/account-mismatch-warning/account-mismatch-warning.component.js b/ui/app/components/ui/account-mismatch-warning/account-mismatch-warning.component.js index ff53cd88f..fc20a9900 100644 --- a/ui/app/components/ui/account-mismatch-warning/account-mismatch-warning.component.js +++ b/ui/app/components/ui/account-mismatch-warning/account-mismatch-warning.component.js @@ -1,7 +1,7 @@ import React from 'react' -import Tooltip from '../tooltip' import { useSelector } from 'react-redux' import PropTypes from 'prop-types' +import Tooltip from '../tooltip' import { getSelectedAccount } from '../../../selectors' import InfoIcon from '../icon/info-icon.component' import { useI18nContext } from '../../../hooks/useI18nContext' diff --git a/ui/app/components/ui/account-mismatch-warning/tests/acccount-mismatch-warning.component.test.js b/ui/app/components/ui/account-mismatch-warning/tests/acccount-mismatch-warning.component.test.js index 56f67443e..f49935770 100644 --- a/ui/app/components/ui/account-mismatch-warning/tests/acccount-mismatch-warning.component.test.js +++ b/ui/app/components/ui/account-mismatch-warning/tests/acccount-mismatch-warning.component.test.js @@ -1,6 +1,6 @@ +import assert from 'assert' import React from 'react' import * as reactRedux from 'react-redux' -import assert from 'assert' import sinon from 'sinon' import { shallow } from 'enzyme' import InfoIcon from '../../icon/info-icon.component' diff --git a/ui/app/components/ui/alert/tests/alert.test.js b/ui/app/components/ui/alert/tests/alert.test.js index 8899f4969..ec32d6633 100644 --- a/ui/app/components/ui/alert/tests/alert.test.js +++ b/ui/app/components/ui/alert/tests/alert.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { shallow } from 'enzyme' import Alert from '../index' diff --git a/ui/app/components/ui/breadcrumbs/tests/breadcrumbs.component.test.js b/ui/app/components/ui/breadcrumbs/tests/breadcrumbs.component.test.js index 7bfff56d8..1fcf2aaea 100644 --- a/ui/app/components/ui/breadcrumbs/tests/breadcrumbs.component.test.js +++ b/ui/app/components/ui/breadcrumbs/tests/breadcrumbs.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import Breadcrumbs from '../breadcrumbs.component' diff --git a/ui/app/components/ui/button-group/button-group.stories.js b/ui/app/components/ui/button-group/button-group.stories.js index 069ae6f2c..e79f8bfea 100644 --- a/ui/app/components/ui/button-group/button-group.stories.js +++ b/ui/app/components/ui/button-group/button-group.stories.js @@ -1,8 +1,8 @@ import React from 'react' import { action } from '@storybook/addon-actions' -import ButtonGroup from '.' -import Button from '../button' import { text, boolean } from '@storybook/addon-knobs/react' +import Button from '../button' +import ButtonGroup from '.' export default { title: 'ButtonGroup', diff --git a/ui/app/components/ui/button-group/tests/button-group-component.test.js b/ui/app/components/ui/button-group/tests/button-group-component.test.js index f963c8696..64a9353d9 100644 --- a/ui/app/components/ui/button-group/tests/button-group-component.test.js +++ b/ui/app/components/ui/button-group/tests/button-group-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import ButtonGroup from '../button-group.component' diff --git a/ui/app/components/ui/button/button.stories.js b/ui/app/components/ui/button/button.stories.js index 7ab14f282..4a251d61b 100644 --- a/ui/app/components/ui/button/button.stories.js +++ b/ui/app/components/ui/button/button.stories.js @@ -1,7 +1,7 @@ import React from 'react' import { action } from '@storybook/addon-actions' -import Button from '.' import { text, boolean } from '@storybook/addon-knobs/react' +import Button from '.' export default { title: 'Button', diff --git a/ui/app/components/ui/card/tests/card.component.test.js b/ui/app/components/ui/card/tests/card.component.test.js index bb7ce3f1a..9eb104351 100644 --- a/ui/app/components/ui/card/tests/card.component.test.js +++ b/ui/app/components/ui/card/tests/card.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import Card from '../card.component' diff --git a/ui/app/components/ui/check-box/check-box.stories.js b/ui/app/components/ui/check-box/check-box.stories.js index 9ddc14a5f..7a573a14c 100644 --- a/ui/app/components/ui/check-box/check-box.stories.js +++ b/ui/app/components/ui/check-box/check-box.stories.js @@ -1,7 +1,7 @@ import React from 'react' import { action } from '@storybook/addon-actions' -import CheckBox, { CHECKED, INDETERMINATE, UNCHECKED } from './check-box.component' import { boolean, select, text } from '@storybook/addon-knobs/react' +import CheckBox, { CHECKED, INDETERMINATE, UNCHECKED } from './check-box.component' export default { title: 'Check Box', diff --git a/ui/app/components/ui/currency-display/tests/currency-display.component.test.js b/ui/app/components/ui/currency-display/tests/currency-display.component.test.js index 862c160f8..68bac84cf 100644 --- a/ui/app/components/ui/currency-display/tests/currency-display.component.test.js +++ b/ui/app/components/ui/currency-display/tests/currency-display.component.test.js @@ -1,9 +1,9 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' -import CurrencyDisplay from '../currency-display.component' import sinon from 'sinon' import * as reactRedux from 'react-redux' +import CurrencyDisplay from '../currency-display.component' describe('CurrencyDisplay Component', function () { beforeEach(function () { diff --git a/ui/app/components/ui/currency-input/currency-input.container.js b/ui/app/components/ui/currency-input/currency-input.container.js index d8c7a572c..581e1c1a2 100644 --- a/ui/app/components/ui/currency-input/currency-input.container.js +++ b/ui/app/components/ui/currency-input/currency-input.container.js @@ -1,11 +1,11 @@ import { connect } from 'react-redux' -import CurrencyInput from './currency-input.component' import { ETH } from '../../../helpers/constants/common' import { getSendMaxModeState, getIsMainnet, getPreferences, } from '../../../selectors' +import CurrencyInput from './currency-input.component' const mapStateToProps = (state) => { const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = state diff --git a/ui/app/components/ui/currency-input/tests/currency-input.component.test.js b/ui/app/components/ui/currency-input/tests/currency-input.component.test.js index adbd4efd2..24c819e56 100644 --- a/ui/app/components/ui/currency-input/tests/currency-input.component.test.js +++ b/ui/app/components/ui/currency-input/tests/currency-input.component.test.js @@ -1,6 +1,6 @@ +import assert from 'assert' import React from 'react' import PropTypes from 'prop-types' -import assert from 'assert' import { shallow, mount } from 'enzyme' import sinon from 'sinon' import { Provider } from 'react-redux' diff --git a/ui/app/components/ui/dropdown/dropdown.stories.js b/ui/app/components/ui/dropdown/dropdown.stories.js index 9b62f3c80..82dd1ca4d 100644 --- a/ui/app/components/ui/dropdown/dropdown.stories.js +++ b/ui/app/components/ui/dropdown/dropdown.stories.js @@ -1,7 +1,7 @@ import React from 'react' import { action } from '@storybook/addon-actions' -import Dropdown from '.' import { boolean, select, text } from '@storybook/addon-knobs/react' +import Dropdown from '.' export default { title: 'Dropdown', diff --git a/ui/app/components/ui/error-message/tests/error-message.component.test.js b/ui/app/components/ui/error-message/tests/error-message.component.test.js index f97b6a949..8e4025bc7 100644 --- a/ui/app/components/ui/error-message/tests/error-message.component.test.js +++ b/ui/app/components/ui/error-message/tests/error-message.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import ErrorMessage from '../error-message.component' diff --git a/ui/app/components/ui/hex-to-decimal/tests/hex-to-decimal.component.test.js b/ui/app/components/ui/hex-to-decimal/tests/hex-to-decimal.component.test.js index 3647d2b22..683bb29d5 100644 --- a/ui/app/components/ui/hex-to-decimal/tests/hex-to-decimal.component.test.js +++ b/ui/app/components/ui/hex-to-decimal/tests/hex-to-decimal.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import HexToDecimal from '../hex-to-decimal.component' diff --git a/ui/app/components/ui/icon/icon.stories.js b/ui/app/components/ui/icon/icon.stories.js index ee52a2f90..95ab1f422 100644 --- a/ui/app/components/ui/icon/icon.stories.js +++ b/ui/app/components/ui/icon/icon.stories.js @@ -1,11 +1,11 @@ import React from 'react' +import { color, number } from '@storybook/addon-knobs/react' import Approve from './approve-icon.component' import Copy from './copy-icon.component' import Interaction from './interaction-icon.component' import Preloader from './preloader' import Receive from './receive-icon.component' import Send from './send-icon.component' -import { color, number } from '@storybook/addon-knobs/react' export default { title: 'Icon', diff --git a/ui/app/components/ui/identicon/identicon.component.js b/ui/app/components/ui/identicon/identicon.component.js index 60886063d..5b91bda23 100644 --- a/ui/app/components/ui/identicon/identicon.component.js +++ b/ui/app/components/ui/identicon/identicon.component.js @@ -3,9 +3,9 @@ import PropTypes from 'prop-types' import classnames from 'classnames' import contractMap from 'eth-contract-metadata' -import BlockieIdenticon from './blockieIdenticon' import { checksumAddress } from '../../../helpers/utils/util' import Jazzicon from '../jazzicon' +import BlockieIdenticon from './blockieIdenticon' const getStyles = (diameter) => ( { diff --git a/ui/app/components/ui/identicon/identicon.stories.js b/ui/app/components/ui/identicon/identicon.stories.js index 69d4d2721..3785080d5 100644 --- a/ui/app/components/ui/identicon/identicon.stories.js +++ b/ui/app/components/ui/identicon/identicon.stories.js @@ -1,7 +1,7 @@ import React from 'react' import { text, boolean } from '@storybook/addon-knobs/react' -import Identicon from './identicon.component' import { number } from '@storybook/addon-knobs' +import Identicon from './identicon.component' export default { title: 'Identicon' } diff --git a/ui/app/components/ui/identicon/tests/identicon.component.test.js b/ui/app/components/ui/identicon/tests/identicon.component.test.js index 8735294a0..f14229bfd 100644 --- a/ui/app/components/ui/identicon/tests/identicon.component.test.js +++ b/ui/app/components/ui/identicon/tests/identicon.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import thunk from 'redux-thunk' import configureMockStore from 'redux-mock-store' import { mount } from 'enzyme' diff --git a/ui/app/components/ui/info-tooltip/info-tooltip.stories.js b/ui/app/components/ui/info-tooltip/info-tooltip.stories.js index 35c1b9fa4..10e6bec09 100644 --- a/ui/app/components/ui/info-tooltip/info-tooltip.stories.js +++ b/ui/app/components/ui/info-tooltip/info-tooltip.stories.js @@ -1,6 +1,6 @@ import React from 'react' -import InfoTooltip from './info-tooltip' import { text } from '@storybook/addon-knobs/react' +import InfoTooltip from './info-tooltip' export default { title: 'InfoTooltip', diff --git a/ui/app/components/ui/list-item/list-item.stories.js b/ui/app/components/ui/list-item/list-item.stories.js index c26015c34..0b7c66143 100644 --- a/ui/app/components/ui/list-item/list-item.stories.js +++ b/ui/app/components/ui/list-item/list-item.stories.js @@ -1,6 +1,5 @@ import React from 'react' import PropTypes from 'prop-types' -import ListItem from './list-item.component' import { text } from '@storybook/addon-knobs/react' import Send from '../icon/send-icon.component' import Interaction from '../icon/interaction-icon.component' @@ -8,6 +7,7 @@ import Approve from '../icon/approve-icon.component' import Receive from '../icon/receive-icon.component' import Preloader from '../icon/preloader' import Button from '../button' +import ListItem from './list-item.component' export default { title: 'ListItem', diff --git a/ui/app/components/ui/list-item/tests/list-item.test.js b/ui/app/components/ui/list-item/tests/list-item.test.js index d5855a75b..10e534446 100644 --- a/ui/app/components/ui/list-item/tests/list-item.test.js +++ b/ui/app/components/ui/list-item/tests/list-item.test.js @@ -1,8 +1,8 @@ +import assert from 'assert' import { shallow } from 'enzyme' import React from 'react' -import ListItem from '../list-item.component' -import assert from 'assert' import Sinon from 'sinon' +import ListItem from '../list-item.component' import Preloader from '../../icon/preloader/preloader-icon.component' import Send from '../../icon/send-icon.component' diff --git a/ui/app/components/ui/menu/menu.stories.js b/ui/app/components/ui/menu/menu.stories.js index c3071c798..02eb2186a 100644 --- a/ui/app/components/ui/menu/menu.stories.js +++ b/ui/app/components/ui/menu/menu.stories.js @@ -1,6 +1,6 @@ import React, { useState } from 'react' -import { Menu, MenuItem } from '.' import { action } from '@storybook/addon-actions' +import { Menu, MenuItem } from '.' export default { title: 'Menu', diff --git a/ui/app/components/ui/metafox-logo/tests/metafox-logo.component.test.js b/ui/app/components/ui/metafox-logo/tests/metafox-logo.component.test.js index b44754c14..acdf4c1c7 100644 --- a/ui/app/components/ui/metafox-logo/tests/metafox-logo.component.test.js +++ b/ui/app/components/ui/metafox-logo/tests/metafox-logo.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { mount } from 'enzyme' import MetaFoxLogo from '..' diff --git a/ui/app/components/ui/page-container/page-container-footer/tests/page-container-footer.component.test.js b/ui/app/components/ui/page-container/page-container-footer/tests/page-container-footer.component.test.js index 268c04466..8a5cf1114 100644 --- a/ui/app/components/ui/page-container/page-container-footer/tests/page-container-footer.component.test.js +++ b/ui/app/components/ui/page-container/page-container-footer/tests/page-container-footer.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import Button from '../../../button' diff --git a/ui/app/components/ui/page-container/page-container-header/tests/page-container-header.component.test.js b/ui/app/components/ui/page-container/page-container-header/tests/page-container-header.component.test.js index 69f5e346b..b544e6f4c 100644 --- a/ui/app/components/ui/page-container/page-container-header/tests/page-container-header.component.test.js +++ b/ui/app/components/ui/page-container/page-container-header/tests/page-container-header.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import PageContainerHeader from '../page-container-header.component' diff --git a/ui/app/components/ui/popover/popover.stories.js b/ui/app/components/ui/popover/popover.stories.js index a7b0aef9b..5108e1f96 100644 --- a/ui/app/components/ui/popover/popover.stories.js +++ b/ui/app/components/ui/popover/popover.stories.js @@ -1,7 +1,7 @@ import React from 'react' -import Popover from './popover.component' import { text } from '@storybook/addon-knobs/react' import { action } from '@storybook/addon-actions' +import Popover from './popover.component' const containerStyle = { width: 800, diff --git a/ui/app/components/ui/sender-to-recipient/sender-to-recipient.component.js b/ui/app/components/ui/sender-to-recipient/sender-to-recipient.component.js index bd18a5749..7af7b2af7 100644 --- a/ui/app/components/ui/sender-to-recipient/sender-to-recipient.component.js +++ b/ui/app/components/ui/sender-to-recipient/sender-to-recipient.component.js @@ -1,13 +1,13 @@ import React, { useState } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' -import Identicon from '../identicon' -import Tooltip from '../tooltip' import copyToClipboard from 'copy-to-clipboard' -import { DEFAULT_VARIANT, CARDS_VARIANT, FLAT_VARIANT } from './sender-to-recipient.constants' +import Tooltip from '../tooltip' +import Identicon from '../identicon' import { checksumAddress, shortenAddress } from '../../../helpers/utils/util' import AccountMismatchWarning from '../account-mismatch-warning/account-mismatch-warning.component' import { useI18nContext } from '../../../hooks/useI18nContext' +import { DEFAULT_VARIANT, CARDS_VARIANT, FLAT_VARIANT } from './sender-to-recipient.constants' const variantHash = { diff --git a/ui/app/components/ui/tabs/tabs.stories.js b/ui/app/components/ui/tabs/tabs.stories.js index 0e2caffed..2cf40736c 100644 --- a/ui/app/components/ui/tabs/tabs.stories.js +++ b/ui/app/components/ui/tabs/tabs.stories.js @@ -1,7 +1,7 @@ import React from 'react' +import { text } from '@storybook/addon-knobs/react' import Tab from './tab/tab.component' import Tabs from './tabs.component' -import { text } from '@storybook/addon-knobs/react' export default { title: 'Tabs', diff --git a/ui/app/components/ui/token-input/tests/token-input.component.test.js b/ui/app/components/ui/token-input/tests/token-input.component.test.js index 201c6b4ab..3ff94d879 100644 --- a/ui/app/components/ui/token-input/tests/token-input.component.test.js +++ b/ui/app/components/ui/token-input/tests/token-input.component.test.js @@ -1,6 +1,6 @@ +import assert from 'assert' import React from 'react' import PropTypes from 'prop-types' -import assert from 'assert' import { shallow, mount } from 'enzyme' import sinon from 'sinon' import { Provider } from 'react-redux' diff --git a/ui/app/components/ui/token-input/token-input.component.js b/ui/app/components/ui/token-input/token-input.component.js index a425b3c0a..785601171 100644 --- a/ui/app/components/ui/token-input/token-input.component.js +++ b/ui/app/components/ui/token-input/token-input.component.js @@ -1,9 +1,9 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' +import ethUtil from 'ethereumjs-util' import UnitInput from '../unit-input' import CurrencyDisplay from '../currency-display' import { getWeiHexFromDecimalValue } from '../../../helpers/utils/conversions.util' -import ethUtil from 'ethereumjs-util' import { conversionUtil, multiplyCurrencies } from '../../../helpers/utils/conversion-util' import { ETH } from '../../../helpers/constants/common' diff --git a/ui/app/components/ui/token-input/token-input.container.js b/ui/app/components/ui/token-input/token-input.container.js index b56efc131..f20670d31 100644 --- a/ui/app/components/ui/token-input/token-input.container.js +++ b/ui/app/components/ui/token-input/token-input.container.js @@ -1,11 +1,11 @@ import { connect } from 'react-redux' import PropTypes from 'prop-types' -import TokenInput from './token-input.component' import { getIsMainnet, getTokenExchangeRates, getPreferences, } from '../../../selectors' +import TokenInput from './token-input.component' const mapStateToProps = (state) => { const { metamask: { currentCurrency } } = state diff --git a/ui/app/components/ui/unit-input/tests/unit-input.component.test.js b/ui/app/components/ui/unit-input/tests/unit-input.component.test.js index 798ae3676..0b92fc5a0 100644 --- a/ui/app/components/ui/unit-input/tests/unit-input.component.test.js +++ b/ui/app/components/ui/unit-input/tests/unit-input.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow, mount } from 'enzyme' import sinon from 'sinon' import UnitInput from '../unit-input.component' diff --git a/ui/app/ducks/confirm-transaction/confirm-transaction.duck.js b/ui/app/ducks/confirm-transaction/confirm-transaction.duck.js index 441b4e161..eb8975265 100644 --- a/ui/app/ducks/confirm-transaction/confirm-transaction.duck.js +++ b/ui/app/ducks/confirm-transaction/confirm-transaction.duck.js @@ -1,3 +1,4 @@ +import { addHexPrefix } from 'ethereumjs-util' import { conversionRateSelector, currentCurrencySelector, @@ -21,7 +22,6 @@ import { } from '../../helpers/utils/transactions.util' import { conversionUtil } from '../../helpers/utils/conversion-util' -import { addHexPrefix } from 'ethereumjs-util' // Actions const createActionType = (action) => `metamask/confirm-transaction/${action}` diff --git a/ui/app/ducks/index.js b/ui/app/ducks/index.js index 09af8914e..91ba222cb 100644 --- a/ui/app/ducks/index.js +++ b/ui/app/ducks/index.js @@ -1,4 +1,5 @@ import { combineReducers } from 'redux' +import { ALERT_TYPES } from '../../../app/scripts/controllers/alert' import metamaskReducer from './metamask/metamask' import localeMessagesReducer from './locale/locale' import sendReducer from './send/send.duck' @@ -7,7 +8,6 @@ import confirmTransactionReducer from './confirm-transaction/confirm-transaction import gasReducer from './gas/gas.duck' import { unconnectedAccount } from './alerts' import historyReducer from './history/history' -import { ALERT_TYPES } from '../../../app/scripts/controllers/alert' export default combineReducers({ [ALERT_TYPES.unconnectedAccount]: unconnectedAccount, diff --git a/ui/app/helpers/utils/common.util.test.js b/ui/app/helpers/utils/common.util.test.js index 169b780b6..cd2d71b03 100644 --- a/ui/app/helpers/utils/common.util.test.js +++ b/ui/app/helpers/utils/common.util.test.js @@ -1,5 +1,5 @@ -import * as utils from './common.util' import assert from 'assert' +import * as utils from './common.util' describe('Common utils', function () { describe('camelCaseToCapitalize', function () { diff --git a/ui/app/helpers/utils/confirm-tx.util.js b/ui/app/helpers/utils/confirm-tx.util.js index e1cd83615..7f456984d 100644 --- a/ui/app/helpers/utils/confirm-tx.util.js +++ b/ui/app/helpers/utils/confirm-tx.util.js @@ -3,6 +3,7 @@ import currencies from 'currency-formatter/currencies' import ethUtil from 'ethereumjs-util' import BigNumber from 'bignumber.js' +import { unconfirmedTransactionsCountSelector } from '../../selectors' import { conversionUtil, addCurrencies, @@ -10,7 +11,6 @@ import { conversionGreaterThan, } from './conversion-util' -import { unconfirmedTransactionsCountSelector } from '../../selectors' export function increaseLastGasPrice (lastGasPrice) { return ethUtil.addHexPrefix(multiplyCurrencies(lastGasPrice || '0x0', 1.1, { diff --git a/ui/app/helpers/utils/confirm-tx.util.test.js b/ui/app/helpers/utils/confirm-tx.util.test.js index 71783402e..065631c7d 100644 --- a/ui/app/helpers/utils/confirm-tx.util.test.js +++ b/ui/app/helpers/utils/confirm-tx.util.test.js @@ -1,5 +1,5 @@ -import * as utils from './confirm-tx.util' import assert from 'assert' +import * as utils from './confirm-tx.util' describe('Confirm Transaction utils', function () { describe('increaseLastGasPrice', function () { diff --git a/ui/app/helpers/utils/conversion-util.test.js b/ui/app/helpers/utils/conversion-util.test.js index 719f7b6d9..9c570f95d 100644 --- a/ui/app/helpers/utils/conversion-util.test.js +++ b/ui/app/helpers/utils/conversion-util.test.js @@ -1,6 +1,6 @@ import assert from 'assert' -import { addCurrencies, conversionUtil } from './conversion-util' import BigNumber from 'bignumber.js' +import { addCurrencies, conversionUtil } from './conversion-util' describe('conversion utils', function () { describe('addCurrencies()', function () { diff --git a/ui/app/helpers/utils/conversions.util.test.js b/ui/app/helpers/utils/conversions.util.test.js index 553fd1fd6..f4c08cc74 100644 --- a/ui/app/helpers/utils/conversions.util.test.js +++ b/ui/app/helpers/utils/conversions.util.test.js @@ -1,5 +1,5 @@ -import * as utils from './conversions.util' import assert from 'assert' +import * as utils from './conversions.util' describe('decETHToDecWEI', function () { it('should correctly convert 1 ETH to WEI', function () { diff --git a/ui/app/helpers/utils/i18n-helper.test.js b/ui/app/helpers/utils/i18n-helper.test.js index 4531865ab..252cbe3f3 100644 --- a/ui/app/helpers/utils/i18n-helper.test.js +++ b/ui/app/helpers/utils/i18n-helper.test.js @@ -1,7 +1,7 @@ -import { getMessage } from './i18n-helper' +import assert from 'assert' import React from 'react' import { shallow } from 'enzyme' -import assert from 'assert' +import { getMessage } from './i18n-helper' describe('i18n helper', function () { const TEST_LOCALE_CODE = 'TEST_LOCALE_CODE' diff --git a/ui/app/helpers/utils/token-util.js b/ui/app/helpers/utils/token-util.js index bc091292a..6d8516ba8 100644 --- a/ui/app/helpers/utils/token-util.js +++ b/ui/app/helpers/utils/token-util.js @@ -1,7 +1,7 @@ import log from 'loglevel' -import * as util from './util' import BigNumber from 'bignumber.js' import contractMap from 'eth-contract-metadata' +import * as util from './util' import { conversionUtil, multiplyCurrencies } from './conversion-util' import { formatCurrency } from './confirm-tx.util' diff --git a/ui/app/helpers/utils/transactions.util.js b/ui/app/helpers/utils/transactions.util.js index 3d14c0336..d94bd24d8 100644 --- a/ui/app/helpers/utils/transactions.util.js +++ b/ui/app/helpers/utils/transactions.util.js @@ -2,14 +2,13 @@ import ethUtil from 'ethereumjs-util' import MethodRegistry from 'eth-method-registry' import abi from 'human-standard-token-abi' import abiDecoder from 'abi-decoder' +import log from 'loglevel' import { TRANSACTION_TYPE_CANCEL, TRANSACTION_STATUS_CONFIRMED, } from '../../../../app/scripts/controllers/transactions/enums' import { MESSAGE_TYPE } from '../../../../app/scripts/lib/enums' import { getEtherscanNetworkPrefix } from '../../../lib/etherscan-prefix-for-network' -import fetchWithCache from './fetch-with-cache' - import { TOKEN_METHOD_TRANSFER, TOKEN_METHOD_APPROVE, @@ -26,8 +25,9 @@ import { CANCEL_ATTEMPT_ACTION_KEY, DEPOSIT_TRANSACTION_KEY, } from '../constants/transactions' +import fetchWithCache from './fetch-with-cache' + -import log from 'loglevel' import { addCurrencies } from './conversion-util' abiDecoder.addABI(abi) diff --git a/ui/app/helpers/utils/transactions.util.test.js b/ui/app/helpers/utils/transactions.util.test.js index f69e41112..ab8b8ba7b 100644 --- a/ui/app/helpers/utils/transactions.util.test.js +++ b/ui/app/helpers/utils/transactions.util.test.js @@ -1,5 +1,5 @@ -import * as utils from './transactions.util' import assert from 'assert' +import * as utils from './transactions.util' describe('Transactions utils', function () { describe('getTokenData', function () { diff --git a/ui/app/helpers/utils/util.js b/ui/app/helpers/utils/util.js index ffd8aa412..899adebaf 100644 --- a/ui/app/helpers/utils/util.js +++ b/ui/app/helpers/utils/util.js @@ -1,7 +1,7 @@ +import punycode from 'punycode' import abi from 'human-standard-token-abi' import ethUtil from 'ethereumjs-util' import { DateTime } from 'luxon' -import punycode from 'punycode' // formatData :: ( date: ) -> String export function formatDate (date, format = 'M/d/y \'at\' T') { diff --git a/ui/app/hooks/tests/useCancelTransaction.test.js b/ui/app/hooks/tests/useCancelTransaction.test.js index 920b9e223..e27eb3586 100644 --- a/ui/app/hooks/tests/useCancelTransaction.test.js +++ b/ui/app/hooks/tests/useCancelTransaction.test.js @@ -1,5 +1,5 @@ -import * as reactRedux from 'react-redux' import assert from 'assert' +import * as reactRedux from 'react-redux' import { renderHook } from '@testing-library/react-hooks' import sinon from 'sinon' import transactions from '../../../../test/data/transaction-data.json' diff --git a/ui/app/hooks/tests/useCurrencyDisplay.test.js b/ui/app/hooks/tests/useCurrencyDisplay.test.js index 850a08960..7be42cd50 100644 --- a/ui/app/hooks/tests/useCurrencyDisplay.test.js +++ b/ui/app/hooks/tests/useCurrencyDisplay.test.js @@ -1,8 +1,8 @@ import assert from 'assert' import { renderHook } from '@testing-library/react-hooks' import * as reactRedux from 'react-redux' -import { useCurrencyDisplay } from '../useCurrencyDisplay' import sinon from 'sinon' +import { useCurrencyDisplay } from '../useCurrencyDisplay' import { getCurrentCurrency, getNativeCurrency, getConversionRate } from '../../selectors' const tests = [ diff --git a/ui/app/hooks/tests/useRetryTransaction.test.js b/ui/app/hooks/tests/useRetryTransaction.test.js index e4e8160a8..b922bd92c 100644 --- a/ui/app/hooks/tests/useRetryTransaction.test.js +++ b/ui/app/hooks/tests/useRetryTransaction.test.js @@ -1,5 +1,5 @@ -import * as reactRedux from 'react-redux' import assert from 'assert' +import * as reactRedux from 'react-redux' import { renderHook } from '@testing-library/react-hooks' import sinon from 'sinon' import transactions from '../../../../test/data/transaction-data.json' diff --git a/ui/app/hooks/tests/useTokenData.test.js b/ui/app/hooks/tests/useTokenData.test.js index 7154581c6..10482b63b 100644 --- a/ui/app/hooks/tests/useTokenData.test.js +++ b/ui/app/hooks/tests/useTokenData.test.js @@ -1,6 +1,6 @@ -import { useTokenData } from '../useTokenData' import assert from 'assert' import { renderHook } from '@testing-library/react-hooks' +import { useTokenData } from '../useTokenData' const tests = [ { diff --git a/ui/app/hooks/tests/useTokenDisplayValue.test.js b/ui/app/hooks/tests/useTokenDisplayValue.test.js index bb8464f8a..ce596168f 100644 --- a/ui/app/hooks/tests/useTokenDisplayValue.test.js +++ b/ui/app/hooks/tests/useTokenDisplayValue.test.js @@ -1,9 +1,9 @@ import assert from 'assert' import { renderHook } from '@testing-library/react-hooks' +import sinon from 'sinon' import * as tokenUtil from '../../helpers/utils/token-util' import * as txUtil from '../../helpers/utils/transactions.util' import { useTokenDisplayValue } from '../useTokenDisplayValue' -import sinon from 'sinon' const tests = [ { diff --git a/ui/app/hooks/tests/useTransactionDisplayData.test.js b/ui/app/hooks/tests/useTransactionDisplayData.test.js index 2cae72bbf..133c9291a 100644 --- a/ui/app/hooks/tests/useTransactionDisplayData.test.js +++ b/ui/app/hooks/tests/useTransactionDisplayData.test.js @@ -1,5 +1,5 @@ -import * as reactRedux from 'react-redux' import assert from 'assert' +import * as reactRedux from 'react-redux' import { renderHook } from '@testing-library/react-hooks' import sinon from 'sinon' import transactions from '../../../../test/data/transaction-data.json' diff --git a/ui/app/hooks/tests/useUserPreferencedCurrency.test.js b/ui/app/hooks/tests/useUserPreferencedCurrency.test.js index 61aba3cb5..65fe25c8e 100644 --- a/ui/app/hooks/tests/useUserPreferencedCurrency.test.js +++ b/ui/app/hooks/tests/useUserPreferencedCurrency.test.js @@ -1,9 +1,9 @@ import assert from 'assert' import { renderHook } from '@testing-library/react-hooks' -import { useUserPreferencedCurrency } from '../useUserPreferencedCurrency' import * as reactRedux from 'react-redux' -import { getPreferences, getShouldShowFiat } from '../../selectors' import sinon from 'sinon' +import { useUserPreferencedCurrency } from '../useUserPreferencedCurrency' +import { getPreferences, getShouldShowFiat } from '../../selectors' const tests = [ { diff --git a/ui/app/hooks/useTokenDisplayValue.js b/ui/app/hooks/useTokenDisplayValue.js index 107a2c11e..b7d92af7c 100644 --- a/ui/app/hooks/useTokenDisplayValue.js +++ b/ui/app/hooks/useTokenDisplayValue.js @@ -1,5 +1,5 @@ -import { getTokenValue, calcTokenAmount } from '../helpers/utils/token-util' import { useMemo } from 'react' +import { getTokenValue, calcTokenAmount } from '../helpers/utils/token-util' import { useTokenData } from './useTokenData' /** diff --git a/ui/app/hooks/useTransactionDisplayData.js b/ui/app/hooks/useTransactionDisplayData.js index 8fca5c65f..3793299f5 100644 --- a/ui/app/hooks/useTransactionDisplayData.js +++ b/ui/app/hooks/useTransactionDisplayData.js @@ -2,11 +2,8 @@ import { useSelector } from 'react-redux' import { getKnownMethodData } from '../selectors/selectors' import { getTransactionActionKey, getStatusKey } from '../helpers/utils/transactions.util' import { camelCaseToCapitalize } from '../helpers/utils/common.util' -import { useI18nContext } from './useI18nContext' -import { useTokenFiatAmount } from './useTokenFiatAmount' import { PRIMARY, SECONDARY } from '../helpers/constants/common' import { getTokenToAddress } from '../helpers/utils/token-util' -import { useUserPreferencedCurrency } from './useUserPreferencedCurrency' import { formatDateWithYearContext, shortenAddress, stripHttpSchemes } from '../helpers/utils/util' import { CONTRACT_INTERACTION_KEY, @@ -24,10 +21,13 @@ import { PENDING_STATUS_HASH, TOKEN_CATEGORY_HASH, } from '../helpers/constants/transactions' +import { getTokens } from '../ducks/metamask/metamask' +import { useI18nContext } from './useI18nContext' +import { useTokenFiatAmount } from './useTokenFiatAmount' +import { useUserPreferencedCurrency } from './useUserPreferencedCurrency' import { useCurrencyDisplay } from './useCurrencyDisplay' import { useTokenDisplayValue } from './useTokenDisplayValue' import { useTokenData } from './useTokenData' -import { getTokens } from '../ducks/metamask/metamask' /** * @typedef {Object} TransactionDisplayData diff --git a/ui/app/hooks/useTransactionTimeRemaining.js b/ui/app/hooks/useTransactionTimeRemaining.js index f7834ead1..825d68552 100644 --- a/ui/app/hooks/useTransactionTimeRemaining.js +++ b/ui/app/hooks/useTransactionTimeRemaining.js @@ -1,9 +1,9 @@ -import { getEstimatedGasPrices, getEstimatedGasTimes, getFeatureFlags, getIsMainnet } from '../selectors' -import { hexWEIToDecGWEI } from '../helpers/utils/conversions.util' import { useSelector } from 'react-redux' import { useRef, useEffect, useState, useMemo } from 'react' import { isEqual } from 'lodash' import { captureException } from '@sentry/browser' +import { hexWEIToDecGWEI } from '../helpers/utils/conversions.util' +import { getEstimatedGasPrices, getEstimatedGasTimes, getFeatureFlags, getIsMainnet } from '../selectors' import { getRawTimeEstimateData } from '../helpers/utils/gas-time-estimates.util' import { getCurrentLocale } from '../ducks/metamask/metamask' diff --git a/ui/app/hooks/useUserPreferencedCurrency.js b/ui/app/hooks/useUserPreferencedCurrency.js index d8d3a1759..986ef6dd7 100644 --- a/ui/app/hooks/useUserPreferencedCurrency.js +++ b/ui/app/hooks/useUserPreferencedCurrency.js @@ -1,5 +1,5 @@ -import { getPreferences, getShouldShowFiat, getNativeCurrency } from '../selectors' import { useSelector } from 'react-redux' +import { getPreferences, getShouldShowFiat, getNativeCurrency } from '../selectors' import { PRIMARY, SECONDARY, ETH } from '../helpers/constants/common' /** diff --git a/ui/app/pages/add-token/add-token.component.js b/ui/app/pages/add-token/add-token.component.js index 158f96a92..48e306fc8 100644 --- a/ui/app/pages/add-token/add-token.component.js +++ b/ui/app/pages/add-token/add-token.component.js @@ -5,10 +5,10 @@ import { checkExistingAddresses } from '../../helpers/utils/util' import { tokenInfoGetter } from '../../helpers/utils/token-util' import { CONFIRM_ADD_TOKEN_ROUTE } from '../../helpers/constants/routes' import TextField from '../../components/ui/text-field' -import TokenList from './token-list' -import TokenSearch from './token-search' import PageContainer from '../../components/ui/page-container' import { Tabs, Tab } from '../../components/ui/tabs' +import TokenList from './token-list' +import TokenSearch from './token-search' const emptyAddr = '0x0000000000000000000000000000000000000000' diff --git a/ui/app/pages/add-token/add-token.container.js b/ui/app/pages/add-token/add-token.container.js index 2e7354b23..9f3f6d21e 100644 --- a/ui/app/pages/add-token/add-token.container.js +++ b/ui/app/pages/add-token/add-token.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' -import AddToken from './add-token.component' import { setPendingTokens, clearPendingTokens } from '../../store/actions' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import AddToken from './add-token.component' const mapStateToProps = (state) => { const { metamask: { identities, tokens, pendingTokens } } = state diff --git a/ui/app/pages/add-token/tests/add-token.test.js b/ui/app/pages/add-token/tests/add-token.test.js index da4a42f20..6fff131cc 100644 --- a/ui/app/pages/add-token/tests/add-token.test.js +++ b/ui/app/pages/add-token/tests/add-token.test.js @@ -1,6 +1,6 @@ +import assert from 'assert' import React from 'react' import { Provider } from 'react-redux' -import assert from 'assert' import sinon from 'sinon' import configureMockStore from 'redux-mock-store' import { mountWithRouter } from '../../../../../test/lib/render-helpers' diff --git a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js index 1b84279b1..319d1ed82 100644 --- a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js +++ b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux' import { compose } from 'redux' -import ConfirmAddSuggestedToken from './confirm-add-suggested-token.component' import { withRouter } from 'react-router-dom' import { addToken, removeSuggestedTokens } from '../../store/actions' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import ConfirmAddSuggestedToken from './confirm-add-suggested-token.component' const mapStateToProps = (state) => { const { metamask: { pendingTokens, suggestedTokens, tokens } } = state diff --git a/ui/app/pages/confirm-add-token/confirm-add-token.container.js b/ui/app/pages/confirm-add-token/confirm-add-token.container.js index d04f15917..8c09ad837 100644 --- a/ui/app/pages/confirm-add-token/confirm-add-token.container.js +++ b/ui/app/pages/confirm-add-token/confirm-add-token.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' -import ConfirmAddToken from './confirm-add-token.component' import { addTokens, clearPendingTokens } from '../../store/actions' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import ConfirmAddToken from './confirm-add-token.component' const mapStateToProps = (state) => { const { metamask: { pendingTokens } } = state diff --git a/ui/app/pages/confirm-approve/confirm-approve.js b/ui/app/pages/confirm-approve/confirm-approve.js index 3a4184e18..5bd634113 100644 --- a/ui/app/pages/confirm-approve/confirm-approve.js +++ b/ui/app/pages/confirm-approve/confirm-approve.js @@ -2,8 +2,6 @@ import React, { useEffect, useRef, useState } from 'react' import { useDispatch, useSelector } from 'react-redux' import { useParams } from 'react-router-dom' import ConfirmTransactionBase from '../confirm-transaction-base' -import ConfirmApproveContent from './confirm-approve-content' -import { getCustomTxParamsData } from './confirm-approve.util' import { showModal } from '../../store/actions' import { getTokenData, @@ -21,6 +19,8 @@ import { } from '../../selectors/confirm-transaction' import { getCurrentCurrency, getDomainMetadata } from '../../selectors/selectors' import { currentNetworkTxListSelector } from '../../selectors/transactions' +import { getCustomTxParamsData } from './confirm-approve.util' +import ConfirmApproveContent from './confirm-approve-content' export default function ConfirmApprove () { const dispatch = useDispatch() diff --git a/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.container.js b/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.container.js index e068b403f..a73649484 100644 --- a/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.container.js +++ b/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.container.js @@ -13,8 +13,8 @@ import { conversionRateSelector, } from '../../selectors' import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck' -import ConfirmDecryptMessage from './confirm-decrypt-message.component' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import ConfirmDecryptMessage from './confirm-decrypt-message.component' function mapStateToProps (state) { const { confirmTransaction, diff --git a/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js b/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js index 8d91540e5..1c376ff5a 100644 --- a/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js +++ b/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js @@ -14,8 +14,8 @@ import { } from '../../selectors' import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck' -import ConfirmEncryptionPublicKey from './confirm-encryption-public-key.component' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import ConfirmEncryptionPublicKey from './confirm-encryption-public-key.component' function mapStateToProps (state) { const { confirmTransaction, diff --git a/ui/app/pages/confirm-send-token/confirm-send-token.container.js b/ui/app/pages/confirm-send-token/confirm-send-token.container.js index ba0517ab0..330f614a8 100644 --- a/ui/app/pages/confirm-send-token/confirm-send-token.container.js +++ b/ui/app/pages/confirm-send-token/confirm-send-token.container.js @@ -1,11 +1,11 @@ import { connect } from 'react-redux' import { compose } from 'redux' import { withRouter } from 'react-router-dom' -import ConfirmSendToken from './confirm-send-token.component' import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck' import { updateSend, showSendTokenPage } from '../../store/actions' import { conversionUtil } from '../../helpers/utils/conversion-util' import { sendTokenTokenAmountAndToAddressSelector } from '../../selectors' +import ConfirmSendToken from './confirm-send-token.component' const mapStateToProps = (state) => { const { tokenAmount } = sendTokenTokenAmountAndToAddressSelector(state) diff --git a/ui/app/pages/confirm-token-transaction-base/confirm-token-transaction-base.container.js b/ui/app/pages/confirm-token-transaction-base/confirm-token-transaction-base.container.js index 0faf6b471..f6e0a270d 100644 --- a/ui/app/pages/confirm-token-transaction-base/confirm-token-transaction-base.container.js +++ b/ui/app/pages/confirm-token-transaction-base/confirm-token-transaction-base.container.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux' import { compose } from 'redux' import { withRouter } from 'react-router-dom' -import ConfirmTokenTransactionBase from './confirm-token-transaction-base.component' import { contractExchangeRateSelector, transactionFeeSelector, @@ -15,6 +14,7 @@ import { getTokenToAddress, getTokenValue, } from '../../helpers/utils/token-util' +import ConfirmTokenTransactionBase from './confirm-token-transaction-base.component' const mapStateToProps = (state, ownProps) => { diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js index 1759e967d..7d002356c 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js @@ -2,7 +2,6 @@ import { connect } from 'react-redux' import { compose } from 'redux' import { withRouter } from 'react-router-dom' import contractMap from 'eth-contract-metadata' -import ConfirmTransactionBase from './confirm-transaction-base.component' import { clearConfirmTransaction, } from '../../ducks/confirm-transaction/confirm-transaction.duck' @@ -38,6 +37,7 @@ import { transactionFeeSelector, } from '../../selectors' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import ConfirmTransactionBase from './confirm-transaction-base.component' const casedContractMap = Object.keys(contractMap).reduce((acc, base) => { return { diff --git a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.container.js b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.container.js index b0d0a8924..dd6970d87 100644 --- a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.container.js +++ b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' -import ConfirmTransactionSwitch from './confirm-transaction-switch.component' import { unconfirmedTransactionsListSelector } from '../../selectors' +import ConfirmTransactionSwitch from './confirm-transaction-switch.component' const mapStateToProps = (state, ownProps) => { const { metamask: { unapprovedTxs } } = state diff --git a/ui/app/pages/confirm-transaction/conf-tx.js b/ui/app/pages/confirm-transaction/conf-tx.js index 40df45a8f..0d7be5418 100644 --- a/ui/app/pages/confirm-transaction/conf-tx.js +++ b/ui/app/pages/confirm-transaction/conf-tx.js @@ -3,9 +3,9 @@ import React, { Component } from 'react' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'redux' +import log from 'loglevel' import * as actions from '../../store/actions' import txHelper from '../../../lib/tx-helper' -import log from 'loglevel' import SignatureRequest from '../../components/app/signature-request' import SignatureRequestOriginal from '../../components/app/signature-request-original' import Loading from '../../components/ui/loading-screen' diff --git a/ui/app/pages/confirm-transaction/confirm-transaction.component.js b/ui/app/pages/confirm-transaction/confirm-transaction.component.js index 47f2b27d9..69af2c226 100644 --- a/ui/app/pages/confirm-transaction/confirm-transaction.component.js +++ b/ui/app/pages/confirm-transaction/confirm-transaction.component.js @@ -9,7 +9,6 @@ import ConfirmSendToken from '../confirm-send-token' import ConfirmDeployContract from '../confirm-deploy-contract' import ConfirmApprove from '../confirm-approve' import ConfirmTokenTransactionBaseContainer from '../confirm-token-transaction-base' -import ConfTx from './conf-tx' import ConfirmDecryptMessage from '../confirm-decrypt-message' import ConfirmEncryptionPublicKey from '../confirm-encryption-public-key' @@ -25,6 +24,7 @@ import { DECRYPT_MESSAGE_REQUEST_PATH, ENCRYPTION_PUBLIC_KEY_REQUEST_PATH, } from '../../helpers/constants/routes' +import ConfTx from './conf-tx' export default class ConfirmTransaction extends Component { static contextTypes = { diff --git a/ui/app/pages/confirm-transaction/confirm-transaction.container.js b/ui/app/pages/confirm-transaction/confirm-transaction.container.js index b0bfccfb8..6ee2579ff 100644 --- a/ui/app/pages/confirm-transaction/confirm-transaction.container.js +++ b/ui/app/pages/confirm-transaction/confirm-transaction.container.js @@ -16,9 +16,9 @@ import { getContractMethodData, getTokenParams, } from '../../store/actions' -import ConfirmTransaction from './confirm-transaction.component' import { unconfirmedTransactionsListSelector } from '../../selectors' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import ConfirmTransaction from './confirm-transaction.component' const mapStateToProps = (state, ownProps) => { const { diff --git a/ui/app/pages/connected-accounts/connected-accounts.container.js b/ui/app/pages/connected-accounts/connected-accounts.container.js index 1bb5ba84a..0fe24583a 100644 --- a/ui/app/pages/connected-accounts/connected-accounts.container.js +++ b/ui/app/pages/connected-accounts/connected-accounts.container.js @@ -1,5 +1,4 @@ import { connect } from 'react-redux' -import ConnectedAccounts from './connected-accounts.component' import { getAccountToConnectToActiveTab, getOrderedConnectedAccountsForActiveTab, @@ -9,6 +8,7 @@ import { import { isExtensionUrl } from '../../helpers/utils/util' import { addPermittedAccount, removePermittedAccount, setSelectedAddress } from '../../store/actions' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import ConnectedAccounts from './connected-accounts.component' const mapStateToProps = (state) => { const { activeTab } = state diff --git a/ui/app/pages/connected-sites/connected-sites.container.js b/ui/app/pages/connected-sites/connected-sites.container.js index a77a2022b..f34558741 100644 --- a/ui/app/pages/connected-sites/connected-sites.container.js +++ b/ui/app/pages/connected-sites/connected-sites.container.js @@ -1,5 +1,4 @@ import { connect } from 'react-redux' -import ConnectedSites from './connected-sites.component' import { getOpenMetamaskTabsIds, requestAccountsPermissionWithId, @@ -17,6 +16,7 @@ import { } from '../../selectors' import { CONNECT_ROUTE } from '../../helpers/constants/routes' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import ConnectedSites from './connected-sites.component' const mapStateToProps = (state) => { const { openMetaMaskTabs } = state.appState diff --git a/ui/app/pages/create-account/connect-hardware/index.js b/ui/app/pages/create-account/connect-hardware/index.js index 32189bf63..689b6058d 100644 --- a/ui/app/pages/create-account/connect-hardware/index.js +++ b/ui/app/pages/create-account/connect-hardware/index.js @@ -3,10 +3,10 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' import * as actions from '../../../store/actions' import { getMetaMaskAccounts } from '../../../selectors' -import SelectHardware from './select-hardware' -import AccountList from './account-list' import { formatBalance } from '../../../helpers/utils/util' import { getMostRecentOverviewPage } from '../../../ducks/history/history' +import SelectHardware from './select-hardware' +import AccountList from './account-list' class ConnectHardwareForm extends Component { state = { diff --git a/ui/app/pages/create-account/create-account.component.js b/ui/app/pages/create-account/create-account.component.js index 2389650e7..2ff859144 100644 --- a/ui/app/pages/create-account/create-account.component.js +++ b/ui/app/pages/create-account/create-account.component.js @@ -2,14 +2,14 @@ import React, { Component } from 'react' import { Switch, Route, matchPath } from 'react-router-dom' import PropTypes from 'prop-types' import classnames from 'classnames' -import NewAccountCreateForm from './new-account.container' -import NewAccountImportForm from './import-account' -import ConnectHardwareForm from './connect-hardware' import { NEW_ACCOUNT_ROUTE, IMPORT_ACCOUNT_ROUTE, CONNECT_HARDWARE_ROUTE, } from '../../helpers/constants/routes' +import NewAccountCreateForm from './new-account.container' +import NewAccountImportForm from './import-account' +import ConnectHardwareForm from './connect-hardware' export default class CreateAccountPage extends Component { renderTabs () { diff --git a/ui/app/pages/create-account/import-account/json.js b/ui/app/pages/create-account/import-account/json.js index 55a77cb4e..cd81fd8c6 100644 --- a/ui/app/pages/create-account/import-account/json.js +++ b/ui/app/pages/create-account/import-account/json.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types' import { withRouter } from 'react-router-dom' import { compose } from 'redux' import { connect } from 'react-redux' -import * as actions from '../../../store/actions' import FileInput from 'react-simple-file-input' +import * as actions from '../../../store/actions' import { getMetaMaskAccounts } from '../../../selectors' import Button from '../../../components/ui/button' import { getMostRecentOverviewPage } from '../../../ducks/history/history' diff --git a/ui/app/pages/create-account/new-account.container.js b/ui/app/pages/create-account/new-account.container.js index 14c33c2f4..d1680b4b3 100644 --- a/ui/app/pages/create-account/new-account.container.js +++ b/ui/app/pages/create-account/new-account.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import * as actions from '../../store/actions' -import NewAccountCreateForm from './new-account.component' import { getMostRecentOverviewPage } from '../../ducks/history/history' +import NewAccountCreateForm from './new-account.component' const mapStateToProps = (state) => { const { metamask: { network, selectedAddress, identities = {} } } = state diff --git a/ui/app/pages/create-account/tests/create-account.test.js b/ui/app/pages/create-account/tests/create-account.test.js index b680057f1..b12ecd36b 100644 --- a/ui/app/pages/create-account/tests/create-account.test.js +++ b/ui/app/pages/create-account/tests/create-account.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mountWithRouter } from '../../../../../test/lib/render-helpers' import CreateAccountPage from '../index' diff --git a/ui/app/pages/first-time-flow/create-password/create-password.component.js b/ui/app/pages/first-time-flow/create-password/create-password.component.js index 5a746d89e..a159601da 100644 --- a/ui/app/pages/first-time-flow/create-password/create-password.component.js +++ b/ui/app/pages/first-time-flow/create-password/create-password.component.js @@ -1,14 +1,14 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { Switch, Route } from 'react-router-dom' -import NewAccount from './new-account' import MetaFoxLogo from '../../../components/ui/metafox-logo' -import ImportWithSeedPhrase from './import-with-seed-phrase' import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE, INITIALIZE_SEED_PHRASE_ROUTE, } from '../../../helpers/constants/routes' +import NewAccount from './new-account' +import ImportWithSeedPhrase from './import-with-seed-phrase' export default class CreatePassword extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js index 018666b13..62d2db4b5 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js @@ -1,10 +1,10 @@ import { connect } from 'react-redux' -import ImportWithSeedPhrase from './import-with-seed-phrase.component' import { setSeedPhraseBackedUp, initializeThreeBox, setCompletedOnboarding, } from '../../../../store/actions' +import ImportWithSeedPhrase from './import-with-seed-phrase.component' const mapDispatchToProps = (dispatch) => { return { diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js index 2156de687..a464bb79e 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import ImportWithSeedPhrase from '../import-with-seed-phrase.component' diff --git a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js index d52f74dbc..9af0970a6 100644 --- a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js +++ b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' -import EndOfFlow from './end-of-flow.component' import { getOnboardingInitiator } from '../../../selectors' +import EndOfFlow from './end-of-flow.component' const firstTimeFlowTypeNameMap = { create: 'New Wallet Created', diff --git a/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js b/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js index 2cc5b9710..6030441a1 100644 --- a/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js +++ b/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mountWithRouter } from '../../../../../../test/lib/render-helpers' import { DEFAULT_ROUTE } from '../../../../helpers/constants/routes' diff --git a/ui/app/pages/first-time-flow/first-time-flow-switch/tests/first-time-flow-switch.test.js b/ui/app/pages/first-time-flow/first-time-flow-switch/tests/first-time-flow-switch.test.js index 3aafd2134..6e3b130bf 100644 --- a/ui/app/pages/first-time-flow/first-time-flow-switch/tests/first-time-flow-switch.test.js +++ b/ui/app/pages/first-time-flow/first-time-flow-switch/tests/first-time-flow-switch.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { mountWithRouter } from '../../../../../../test/lib/render-helpers' import { DEFAULT_ROUTE, diff --git a/ui/app/pages/first-time-flow/first-time-flow.component.js b/ui/app/pages/first-time-flow/first-time-flow.component.js index a0dee962b..0c9474161 100644 --- a/ui/app/pages/first-time-flow/first-time-flow.component.js +++ b/ui/app/pages/first-time-flow/first-time-flow.component.js @@ -1,14 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { Switch, Route } from 'react-router-dom' -import FirstTimeFlowSwitch from './first-time-flow-switch' -import Welcome from './welcome' -import SelectAction from './select-action' -import EndOfFlow from './end-of-flow' import Unlock from '../unlock-page' -import CreatePassword from './create-password' -import SeedPhrase from './seed-phrase' -import MetaMetricsOptInScreen from './metametrics-opt-in' import { DEFAULT_ROUTE, INITIALIZE_WELCOME_ROUTE, @@ -20,6 +13,13 @@ import { INITIALIZE_METAMETRICS_OPT_IN_ROUTE, INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, } from '../../helpers/constants/routes' +import FirstTimeFlowSwitch from './first-time-flow-switch' +import Welcome from './welcome' +import SelectAction from './select-action' +import EndOfFlow from './end-of-flow' +import CreatePassword from './create-password' +import SeedPhrase from './seed-phrase' +import MetaMetricsOptInScreen from './metametrics-opt-in' export default class FirstTimeFlow extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/first-time-flow.container.js b/ui/app/pages/first-time-flow/first-time-flow.container.js index e0070b853..fbab9df42 100644 --- a/ui/app/pages/first-time-flow/first-time-flow.container.js +++ b/ui/app/pages/first-time-flow/first-time-flow.container.js @@ -1,5 +1,4 @@ import { connect } from 'react-redux' -import FirstTimeFlow from './first-time-flow.component' import { getFirstTimeFlowTypeRoute } from '../../selectors' import { createNewVaultAndGetSeedPhrase, @@ -10,6 +9,7 @@ import { import { INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, } from '../../helpers/constants/routes' +import FirstTimeFlow from './first-time-flow.component' const mapStateToProps = (state, ownProps) => { const { metamask: { completedOnboarding, isInitialized, isUnlocked, seedPhraseBackedUp } } = state diff --git a/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js b/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js index 7c54fd980..aeb323915 100644 --- a/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js +++ b/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' -import MetaMetricsOptIn from './metametrics-opt-in.component' import { setParticipateInMetaMetrics } from '../../../store/actions' import { getFirstTimeFlowTypeRoute } from '../../../selectors' +import MetaMetricsOptIn from './metametrics-opt-in.component' const firstTimeFlowTypeNameMap = { create: 'Selected Create New Wallet', diff --git a/ui/app/pages/first-time-flow/metametrics-opt-in/tests/metametrics-opt-in.test.js b/ui/app/pages/first-time-flow/metametrics-opt-in/tests/metametrics-opt-in.test.js index c3b7f04fe..c8a2491ff 100644 --- a/ui/app/pages/first-time-flow/metametrics-opt-in/tests/metametrics-opt-in.test.js +++ b/ui/app/pages/first-time-flow/metametrics-opt-in/tests/metametrics-opt-in.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import configureMockStore from 'redux-mock-store' import { mountWithRouter } from '../../../../../../test/lib/render-helpers' diff --git a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js index 176601e49..8fece3bba 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js @@ -1,10 +1,10 @@ import { connect } from 'react-redux' -import ConfirmSeedPhrase from './confirm-seed-phrase.component' import { setSeedPhraseBackedUp, initializeThreeBox, setCompletedOnboarding, } from '../../../../store/actions' +import ConfirmSeedPhrase from './confirm-seed-phrase.component' const mapDispatchToProps = (dispatch) => { return { diff --git a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js index c1bf9109c..64289adc0 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js @@ -1,10 +1,10 @@ import { connect } from 'react-redux' -import RevealSeedPhrase from './reveal-seed-phrase.component' import { setCompletedOnboarding, setSeedPhraseBackedUp, } from '../../../../store/actions' import { getOnboardingInitiator } from '../../../../selectors' +import RevealSeedPhrase from './reveal-seed-phrase.component' const mapStateToProps = (state) => { return { diff --git a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/tests/reveal-seed-phrase.test.js b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/tests/reveal-seed-phrase.test.js index dfc045778..62d64d5b6 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/tests/reveal-seed-phrase.test.js +++ b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/tests/reveal-seed-phrase.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import RevealSeedPhrase from '../index' diff --git a/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js b/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js index ade1904c4..6e6201a03 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js @@ -1,17 +1,17 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { Switch, Route } from 'react-router-dom' -import RevealSeedPhrase from './reveal-seed-phrase' -import ConfirmSeedPhrase from './confirm-seed-phrase' +import HTML5Backend from 'react-dnd-html5-backend' +import { DragDropContextProvider } from 'react-dnd' import { INITIALIZE_SEED_PHRASE_ROUTE, INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE, INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, DEFAULT_ROUTE, } from '../../../helpers/constants/routes' -import HTML5Backend from 'react-dnd-html5-backend' -import { DragDropContextProvider } from 'react-dnd' import MetaFoxLogo from '../../../components/ui/metafox-logo' +import ConfirmSeedPhrase from './confirm-seed-phrase' +import RevealSeedPhrase from './reveal-seed-phrase' export default class SeedPhrase extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js b/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js index a5846a944..78c77d3a7 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js +++ b/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import ConfirmSeedPhrase from '../confirm-seed-phrase/confirm-seed-phrase.component' diff --git a/ui/app/pages/first-time-flow/select-action/tests/select-action.test.js b/ui/app/pages/first-time-flow/select-action/tests/select-action.test.js index 2293cd6a5..6d7954276 100644 --- a/ui/app/pages/first-time-flow/select-action/tests/select-action.test.js +++ b/ui/app/pages/first-time-flow/select-action/tests/select-action.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mountWithRouter } from '../../../../../../test/lib/render-helpers' import SelectAction from '../index' diff --git a/ui/app/pages/first-time-flow/welcome/tests/welcome.test.js b/ui/app/pages/first-time-flow/welcome/tests/welcome.test.js index 510334dca..0e3a762a8 100644 --- a/ui/app/pages/first-time-flow/welcome/tests/welcome.test.js +++ b/ui/app/pages/first-time-flow/welcome/tests/welcome.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import configureMockStore from 'redux-mock-store' import { mountWithRouter } from '../../../../../../test/lib/render-helpers' diff --git a/ui/app/pages/home/home.container.js b/ui/app/pages/home/home.container.js index 8a1c0eed7..a42e53911 100644 --- a/ui/app/pages/home/home.container.js +++ b/ui/app/pages/home/home.container.js @@ -1,4 +1,3 @@ -import Home from './home.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -23,6 +22,7 @@ import { ENVIRONMENT_TYPE_NOTIFICATION, ENVIRONMENT_TYPE_POPUP, } from '../../../../app/scripts/lib/enums' +import Home from './home.component' const mapStateToProps = (state) => { const { metamask, appState } = state diff --git a/ui/app/pages/index.js b/ui/app/pages/index.js index 5ec61b4d2..16e63204c 100644 --- a/ui/app/pages/index.js +++ b/ui/app/pages/index.js @@ -3,10 +3,10 @@ import PropTypes from 'prop-types' import { Provider } from 'react-redux' import { HashRouter } from 'react-router-dom' import * as Sentry from '@sentry/browser' -import ErrorPage from './error' -import Routes from './routes' import { I18nProvider, LegacyI18nProvider } from '../contexts/i18n' import { MetaMetricsProvider, LegacyMetaMetricsProvider } from '../contexts/metametrics' +import ErrorPage from './error' +import Routes from './routes' class Index extends PureComponent { state = {} diff --git a/ui/app/pages/keychains/tests/reveal-seed.test.js b/ui/app/pages/keychains/tests/reveal-seed.test.js index 7a5325aca..ee89b58c6 100644 --- a/ui/app/pages/keychains/tests/reveal-seed.test.js +++ b/ui/app/pages/keychains/tests/reveal-seed.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import RevealSeedPage from '../reveal-seed' diff --git a/ui/app/pages/lock/lock.container.js b/ui/app/pages/lock/lock.container.js index 382f936c7..e7e12b103 100644 --- a/ui/app/pages/lock/lock.container.js +++ b/ui/app/pages/lock/lock.container.js @@ -1,8 +1,8 @@ -import Lock from './lock.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { lockMetamask } from '../../store/actions' +import Lock from './lock.component' const mapStateToProps = (state) => { const { metamask: { isUnlocked } } = state diff --git a/ui/app/pages/lock/tests/lock.test.js b/ui/app/pages/lock/tests/lock.test.js index 85eff210a..77a1a7203 100644 --- a/ui/app/pages/lock/tests/lock.test.js +++ b/ui/app/pages/lock/tests/lock.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mountWithRouter } from '../../../../../test/lib/render-helpers' import Lock from '../index' diff --git a/ui/app/pages/mobile-sync/mobile-sync.container.js b/ui/app/pages/mobile-sync/mobile-sync.container.js index 053f05d81..3c3bf6053 100644 --- a/ui/app/pages/mobile-sync/mobile-sync.container.js +++ b/ui/app/pages/mobile-sync/mobile-sync.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { displayWarning, requestRevealSeedWords, fetchInfoToSync, exportAccounts } from '../../store/actions' -import MobileSyncPage from './mobile-sync.component' import { getMostRecentOverviewPage } from '../../ducks/history/history' import { getMetaMaskKeyrings } from '../../selectors' +import MobileSyncPage from './mobile-sync.component' const mapDispatchToProps = (dispatch) => { return { diff --git a/ui/app/pages/permissions-connect/permissions-connect.container.js b/ui/app/pages/permissions-connect/permissions-connect.container.js index e522e864f..e65677a4d 100644 --- a/ui/app/pages/permissions-connect/permissions-connect.container.js +++ b/ui/app/pages/permissions-connect/permissions-connect.container.js @@ -1,6 +1,5 @@ import { connect } from 'react-redux' import PropTypes from 'prop-types' -import PermissionApproval from './permissions-connect.component' import { getPermissionsRequests, getNativeCurrency, @@ -22,6 +21,7 @@ import { CONNECT_ROUTE, CONNECT_CONFIRM_PERMISSIONS_ROUTE, } from '../../helpers/constants/routes' +import PermissionApproval from './permissions-connect.component' const mapStateToProps = (state, ownProps) => { const { diff --git a/ui/app/pages/routes/routes.container.js b/ui/app/pages/routes/routes.container.js index d4a638250..9fdfa9067 100644 --- a/ui/app/pages/routes/routes.container.js +++ b/ui/app/pages/routes/routes.container.js @@ -7,7 +7,6 @@ import { getPreferences, submittedPendingTransactionsSelector, } from '../../selectors' -import Routes from './routes.component' import { hideSidebar, lockMetamask, @@ -16,6 +15,7 @@ import { setMouseUserState, } from '../../store/actions' import { pageChanged } from '../../ducks/history/history' +import Routes from './routes.component' function mapStateToProps (state) { const { appState } = state diff --git a/ui/app/pages/send/send-content/add-recipient/add-recipient.js b/ui/app/pages/send/send-content/add-recipient/add-recipient.js index a5407ece0..c669e1943 100644 --- a/ui/app/pages/send/send-content/add-recipient/add-recipient.js +++ b/ui/app/pages/send/send-content/add-recipient/add-recipient.js @@ -1,3 +1,5 @@ +import ethUtil from 'ethereumjs-util' +import contractMap from 'eth-contract-metadata' import { REQUIRED_ERROR, INVALID_RECIPIENT_ADDRESS_ERROR, @@ -6,8 +8,6 @@ import { } from '../../send.constants' import { isValidAddress, isEthNetwork, checkExistingAddresses } from '../../../../helpers/utils/util' -import ethUtil from 'ethereumjs-util' -import contractMap from 'eth-contract-metadata' export function getToErrorObject (to, hasHexData = false, network) { let toError = null diff --git a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js index 392b9af77..f36b95594 100644 --- a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js +++ b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js @@ -1,14 +1,14 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' -import { isValidDomainName, isValidAddress, isValidAddressHead } from '../../../../helpers/utils/util' -import { ellipsify } from '../../send.utils' import { debounce } from 'lodash' import copyToClipboard from 'copy-to-clipboard/index' import ENS from 'ethjs-ens' import networkMap from 'ethereum-ens-network-map' import log from 'loglevel' +import { ellipsify } from '../../send.utils' +import { isValidDomainName, isValidAddress, isValidAddressHead } from '../../../../helpers/utils/util' // Local Constants diff --git a/ui/app/pages/send/send-content/add-recipient/ens-input.container.js b/ui/app/pages/send/send-content/add-recipient/ens-input.container.js index 48d266db4..479773e9e 100644 --- a/ui/app/pages/send/send-content/add-recipient/ens-input.container.js +++ b/ui/app/pages/send/send-content/add-recipient/ens-input.container.js @@ -1,11 +1,11 @@ import { connect } from 'react-redux' -import EnsInput from './ens-input.component' import { getCurrentNetwork, getSendTo, getSendToNickname, getAddressBookEntry, } from '../../../../selectors' +import EnsInput from './ens-input.component' export default connect( (state) => { diff --git a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-component.test.js b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-component.test.js index b031323be..5d88e4e09 100644 --- a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-component.test.js +++ b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import AddRecipient from '../add-recipient.component' diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js index e187a1592..1113ad7f9 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js @@ -7,15 +7,15 @@ import { getSendMaxModeState, getBasicGasEstimateLoadingStatus, } from '../../../../../selectors' -import { calcMaxAmount } from './amount-max-button.utils' import { updateSendAmount, setMaxModeTo, } from '../../../../../store/actions' -import AmountMaxButton from './amount-max-button.component' import { updateSendErrors, } from '../../../../../ducks/send/send.duck' +import { calcMaxAmount } from './amount-max-button.utils' +import AmountMaxButton from './amount-max-button.component' export default connect(mapStateToProps, mapDispatchToProps)(AmountMaxButton) diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js index 606ab6a84..f27207ecb 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js @@ -1,5 +1,5 @@ -import { multiplyCurrencies, subtractCurrencies } from '../../../../../helpers/utils/conversion-util' import ethUtil from 'ethereumjs-util' +import { multiplyCurrencies, subtractCurrencies } from '../../../../../helpers/utils/conversion-util' export function calcMaxAmount ({ balance, gasTotal, sendToken, tokenBalance }) { const { decimals } = sendToken || {} diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js index 008bcec30..7ba387c51 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import AmountMaxButton from '../amount-max-button.component' diff --git a/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js index 37b764fbc..c21c38509 100644 --- a/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js +++ b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js @@ -2,9 +2,9 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import { debounce } from 'lodash' import SendRowWrapper from '../send-row-wrapper' -import AmountMaxButton from './amount-max-button' import UserPreferencedCurrencyInput from '../../../../components/app/user-preferenced-currency-input' import UserPreferencedTokenInput from '../../../../components/app/user-preferenced-token-input' +import AmountMaxButton from './amount-max-button' export default class SendAmountRow extends Component { diff --git a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js index b22819f25..fa1e5a2aa 100644 --- a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import SendAmountRow from '../send-amount-row.component' diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js index 3fdb4803c..dbbf2dddb 100644 --- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' -import SendAssetRow from './send-asset-row.component' import { getMetaMaskAccounts, getSendTokenAddress } from '../../../../selectors' import { updateSendToken } from '../../../../store/actions' +import SendAssetRow from './send-asset-row.component' function mapStateToProps (state) { return { diff --git a/ui/app/pages/send/send-content/send-content.component.js b/ui/app/pages/send/send-content/send-content.component.js index 9188140f9..a764849f9 100644 --- a/ui/app/pages/send/send-content/send-content.component.js +++ b/ui/app/pages/send/send-content/send-content.component.js @@ -1,11 +1,11 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import PageContainerContent from '../../../components/ui/page-container/page-container-content.component' +import Dialog from '../../../components/ui/dialog' import SendAmountRow from './send-amount-row' import SendGasRow from './send-gas-row' import SendHexDataRow from './send-hex-data-row' import SendAssetRow from './send-asset-row' -import Dialog from '../../../components/ui/dialog' export default class SendContent extends Component { diff --git a/ui/app/pages/send/send-content/send-content.container.js b/ui/app/pages/send/send-content/send-content.container.js index 8ee785736..5cde49de9 100644 --- a/ui/app/pages/send/send-content/send-content.container.js +++ b/ui/app/pages/send/send-content/send-content.container.js @@ -1,5 +1,4 @@ import { connect } from 'react-redux' -import SendContent from './send-content.component' import { getSendTo, accountsWithSendEtherInfoSelector, @@ -7,6 +6,7 @@ import { } from '../../../selectors' import * as actions from '../../../store/actions' +import SendContent from './send-content.component' function mapStateToProps (state) { const ownedAccounts = accountsWithSendEtherInfoSelector(state) diff --git a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/tests/gas-fee-display.component.test.js b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/tests/gas-fee-display.component.test.js index 63a0eba57..b479efb9d 100644 --- a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/tests/gas-fee-display.component.test.js +++ b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/tests/gas-fee-display.component.test.js @@ -1,9 +1,9 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' +import sinon from 'sinon' import GasFeeDisplay from '../gas-fee-display.component' import UserPreferencedCurrencyDisplay from '../../../../../../components/app/user-preferenced-currency-display' -import sinon from 'sinon' const propsMethodSpies = { showCustomizeGasModal: sinon.spy(), diff --git a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js index 5f593e01b..3d22971d5 100644 --- a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js +++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js @@ -1,9 +1,9 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import SendRowWrapper from '../send-row-wrapper' -import GasFeeDisplay from './gas-fee-display/gas-fee-display.component' import GasPriceButtonGroup from '../../../../components/app/gas-customization/gas-price-button-group' import AdvancedGasInputs from '../../../../components/app/gas-customization/advanced-gas-inputs' +import GasFeeDisplay from './gas-fee-display/gas-fee-display.component' export default class SendGasRow extends Component { diff --git a/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js index 45c5683b6..9c8224043 100644 --- a/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js +++ b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import SendGasRow from '../send-gas-row.component' diff --git a/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js index 6213173c2..1255aac49 100644 --- a/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import SendRowErrorMessage from '../send-row-error-message.component' diff --git a/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js b/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js index 424014441..00f3ceb7f 100644 --- a/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import SendRowWrapper from '../send-row-wrapper.component' diff --git a/ui/app/pages/send/send-content/tests/send-content-component.test.js b/ui/app/pages/send/send-content/tests/send-content-component.test.js index 6fdb76312..3687e8711 100644 --- a/ui/app/pages/send/send-content/tests/send-content-component.test.js +++ b/ui/app/pages/send/send-content/tests/send-content-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import SendContent from '../send-content.component' diff --git a/ui/app/pages/send/send-footer/send-footer.container.js b/ui/app/pages/send/send-footer/send-footer.container.js index 02379a9e6..6ffda4952 100644 --- a/ui/app/pages/send/send-footer/send-footer.container.js +++ b/ui/app/pages/send/send-footer/send-footer.container.js @@ -26,13 +26,13 @@ import { getRenderableEstimateDataForSmallButtonsFromGWEI, getDefaultActiveButtonIndex, } from '../../../selectors' +import { getMostRecentOverviewPage } from '../../../ducks/history/history' import SendFooter from './send-footer.component' import { addressIsNew, constructTxParams, constructUpdatedTx, } from './send-footer.utils' -import { getMostRecentOverviewPage } from '../../../ducks/history/history' export default connect(mapStateToProps, mapDispatchToProps)(SendFooter) diff --git a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js index ba2c8c1e5..ef502e0aa 100644 --- a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import { CONFIRM_TRANSACTION_ROUTE } from '../../../../helpers/constants/routes' diff --git a/ui/app/pages/send/send-header/send-header.container.js b/ui/app/pages/send/send-header/send-header.container.js index e79d359c7..e89d127d3 100644 --- a/ui/app/pages/send/send-header/send-header.container.js +++ b/ui/app/pages/send/send-header/send-header.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { clearSend } from '../../../store/actions' -import SendHeader from './send-header.component' import { getTitleKey } from '../../../selectors' import { getMostRecentOverviewPage } from '../../../ducks/history/history' +import SendHeader from './send-header.component' export default connect(mapStateToProps, mapDispatchToProps)(SendHeader) diff --git a/ui/app/pages/send/send-header/tests/send-header-component.test.js b/ui/app/pages/send/send-header/tests/send-header-component.test.js index 3667a2504..2844bc879 100644 --- a/ui/app/pages/send/send-header/tests/send-header-component.test.js +++ b/ui/app/pages/send/send-header/tests/send-header-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import { shallow } from 'enzyme' import sinon from 'sinon' import SendHeader from '../send-header.component' diff --git a/ui/app/pages/send/send.component.js b/ui/app/pages/send/send.component.js index 0c7f7804a..882c2edd6 100644 --- a/ui/app/pages/send/send.component.js +++ b/ui/app/pages/send/send.component.js @@ -1,12 +1,12 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' +import { debounce } from 'lodash' import { getAmountErrorObject, getGasFeeErrorObject, getToAddressForGasUpdate, doesAmountErrorRequireUpdate, } from './send.utils' -import { debounce } from 'lodash' import { getToWarningObject, getToErrorObject } from './send-content/add-recipient/add-recipient' import SendHeader from './send-header' import AddRecipient from './send-content/add-recipient' diff --git a/ui/app/pages/send/send.container.js b/ui/app/pages/send/send.container.js index ca58a3e7d..34e876aae 100644 --- a/ui/app/pages/send/send.container.js +++ b/ui/app/pages/send/send.container.js @@ -1,5 +1,4 @@ import { connect } from 'react-redux' -import SendEther from './send.component' import { withRouter } from 'react-router-dom' import { compose } from 'redux' @@ -43,12 +42,13 @@ import { fetchBasicGasEstimates, } from '../../ducks/gas/gas.duck' import { getTokens } from '../../ducks/metamask/metamask' -import { - calcGasTotal, -} from './send.utils' import { isValidDomainName, } from '../../helpers/utils/util' +import { + calcGasTotal, +} from './send.utils' +import SendEther from './send.component' function mapStateToProps (state) { const editingTransactionId = getSendEditingTransactionId(state) diff --git a/ui/app/pages/send/send.utils.js b/ui/app/pages/send/send.utils.js index ed01da74c..fe208f7be 100644 --- a/ui/app/pages/send/send.utils.js +++ b/ui/app/pages/send/send.utils.js @@ -1,3 +1,5 @@ +import abi from 'ethereumjs-abi' +import ethUtil from 'ethereumjs-util' import { addCurrencies, conversionUtil, @@ -19,8 +21,6 @@ import { TOKEN_TRANSFER_FUNCTION_SIGNATURE, } from './send.constants' -import abi from 'ethereumjs-abi' -import ethUtil from 'ethereumjs-util' export { addGasBuffer, diff --git a/ui/app/pages/send/tests/send-component.test.js b/ui/app/pages/send/tests/send-component.test.js index 43c296009..5a157aa6b 100644 --- a/ui/app/pages/send/tests/send-component.test.js +++ b/ui/app/pages/send/tests/send-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import proxyquire from 'proxyquire' import { shallow } from 'enzyme' import sinon from 'sinon' diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js index c36bc204f..64777f4fa 100644 --- a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js +++ b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js @@ -1,4 +1,3 @@ -import AdvancedTab from './advanced-tab.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -14,6 +13,7 @@ import { setIpfsGateway, } from '../../../store/actions' import { getPreferences } from '../../../selectors' +import AdvancedTab from './advanced-tab.component' export const mapStateToProps = (state) => { const { appState: { warning }, metamask } = state diff --git a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js index cd8e9a200..548623187 100644 --- a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js +++ b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { shallow } from 'enzyme' import AdvancedTab from '../advanced-tab.component' diff --git a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js index 20ebdcee6..12f420186 100644 --- a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js +++ b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js @@ -1,12 +1,12 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' +import { debounce } from 'lodash' import Identicon from '../../../../components/ui/identicon' import TextField from '../../../../components/ui/text-field' import { CONTACT_LIST_ROUTE } from '../../../../helpers/constants/routes' import { isValidAddress, isValidDomainName } from '../../../../helpers/utils/util' import EnsInput from '../../../send/send-content/add-recipient/ens-input' import PageContainerFooter from '../../../../components/ui/page-container/page-container-footer' -import { debounce } from 'lodash' export default class AddContact extends PureComponent { diff --git a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js index 66c40e51a..9c5993e4f 100644 --- a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js +++ b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js @@ -1,4 +1,3 @@ -import AddContact from './add-contact.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -6,6 +5,7 @@ import { addToAddressBook, showQrScanner, qrCodeDetected } from '../../../../sto import { getQrCodeData, } from '../../../../selectors' +import AddContact from './add-contact.component' const mapStateToProps = (state) => { return { diff --git a/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js b/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js index dfcb35c19..fc6dc5354 100644 --- a/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js +++ b/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js @@ -1,15 +1,15 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import ContactList from '../../../components/app/contact-list' -import EditContact from './edit-contact' -import AddContact from './add-contact' -import ViewContact from './view-contact' -import MyAccounts from './my-accounts' import { CONTACT_ADD_ROUTE, CONTACT_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_ROUTE, } from '../../../helpers/constants/routes' +import EditContact from './edit-contact' +import AddContact from './add-contact' +import ViewContact from './view-contact' +import MyAccounts from './my-accounts' export default class ContactListTab extends Component { static contextTypes = { diff --git a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js index 63a7db52d..8871830a8 100644 --- a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js +++ b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js @@ -1,4 +1,3 @@ -import ContactListTab from './contact-list-tab.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -14,6 +13,7 @@ import { CONTACT_MY_ACCOUNTS_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, } from '../../../helpers/constants/routes' +import ContactListTab from './contact-list-tab.component' const mapStateToProps = (state, ownProps) => { diff --git a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js index 4cd7bd59e..b372fae5f 100644 --- a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js +++ b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js @@ -1,4 +1,3 @@ -import EditContact from './edit-contact.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -11,6 +10,7 @@ import { CONTACT_LIST_ROUTE, } from '../../../../helpers/constants/routes' import { addToAddressBook, removeFromAddressBook, setAccountLabel } from '../../../../store/actions' +import EditContact from './edit-contact.component' const mapStateToProps = (state, ownProps) => { const { location } = ownProps diff --git a/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.container.js b/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.container.js index 86e569e3d..6dab955b6 100644 --- a/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.container.js +++ b/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.container.js @@ -1,8 +1,8 @@ -import ViewContact from './my-accounts.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { accountsWithSendEtherInfoSelector } from '../../../../selectors' +import ViewContact from './my-accounts.component' const mapStateToProps = (state) => { const myAccounts = accountsWithSendEtherInfoSelector(state) diff --git a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js index 33579d154..87bf707db 100644 --- a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js +++ b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js @@ -1,4 +1,3 @@ -import ViewContact from './view-contact.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -11,6 +10,7 @@ import { CONTACT_MY_ACCOUNTS_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, } from '../../../../helpers/constants/routes' +import ViewContact from './view-contact.component' const mapStateToProps = (state, ownProps) => { const { location } = ownProps diff --git a/ui/app/pages/settings/networks-tab/networks-tab.component.js b/ui/app/pages/settings/networks-tab/networks-tab.component.js index e0046edfc..f9cb61048 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.component.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.component.js @@ -1,12 +1,12 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' +import classnames from 'classnames' import { SETTINGS_ROUTE } from '../../../helpers/constants/routes' import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' -import classnames from 'classnames' import Button from '../../../components/ui/button' -import NetworkForm from './network-form' import NetworkDropdownIcon from '../../../components/app/dropdowns/components/network-dropdown-icon' +import NetworkForm from './network-form' export default class NetworksTab extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/settings/networks-tab/networks-tab.container.js b/ui/app/pages/settings/networks-tab/networks-tab.container.js index 9377a1111..282078246 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.container.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.container.js @@ -1,4 +1,3 @@ -import NetworksTab from './networks-tab.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -10,6 +9,7 @@ import { editRpc, showModal, } from '../../../store/actions' +import NetworksTab from './networks-tab.component' import { defaultNetworksData } from './networks-tab.constants' const defaultNetworks = defaultNetworksData.map((network) => ({ ...network, viewOnly: true })) diff --git a/ui/app/pages/settings/security-tab/security-tab.container.js b/ui/app/pages/settings/security-tab/security-tab.container.js index 9852b685e..cfbcfbeb9 100644 --- a/ui/app/pages/settings/security-tab/security-tab.container.js +++ b/ui/app/pages/settings/security-tab/security-tab.container.js @@ -1,4 +1,3 @@ -import SecurityTab from './security-tab.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -7,6 +6,7 @@ import { setParticipateInMetaMetrics, setUsePhishDetect, } from '../../../store/actions' +import SecurityTab from './security-tab.component' const mapStateToProps = (state) => { const { appState: { warning }, metamask } = state diff --git a/ui/app/pages/settings/security-tab/tests/security-tab.test.js b/ui/app/pages/settings/security-tab/tests/security-tab.test.js index d5720aa6a..1fa1b2eb8 100644 --- a/ui/app/pages/settings/security-tab/tests/security-tab.test.js +++ b/ui/app/pages/settings/security-tab/tests/security-tab.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import SecurityTab from '../index' diff --git a/ui/app/pages/settings/settings-tab/settings-tab.container.js b/ui/app/pages/settings/settings-tab/settings-tab.container.js index 1d9f65750..0915ccf7c 100644 --- a/ui/app/pages/settings/settings-tab/settings-tab.container.js +++ b/ui/app/pages/settings/settings-tab/settings-tab.container.js @@ -1,4 +1,3 @@ -import SettingsTab from './settings-tab.component' import { connect } from 'react-redux' import { setCurrentCurrency, @@ -8,6 +7,7 @@ import { setParticipateInMetaMetrics, } from '../../../store/actions' import { getPreferences } from '../../../selectors' +import SettingsTab from './settings-tab.component' const mapStateToProps = (state) => { const { appState: { warning }, metamask } = state diff --git a/ui/app/pages/settings/settings-tab/tests/settings-tab.test.js b/ui/app/pages/settings/settings-tab/tests/settings-tab.test.js index 7fefd559e..290d5081a 100644 --- a/ui/app/pages/settings/settings-tab/tests/settings-tab.test.js +++ b/ui/app/pages/settings/settings-tab/tests/settings-tab.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import SettingsTab from '../index' diff --git a/ui/app/pages/settings/settings.component.js b/ui/app/pages/settings/settings.component.js index 866ed4be7..d4372eed0 100644 --- a/ui/app/pages/settings/settings.component.js +++ b/ui/app/pages/settings/settings.component.js @@ -1,15 +1,8 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { Switch, Route, matchPath } from 'react-router-dom' -import TabBar from '../../components/app/tab-bar' import classnames from 'classnames' -import SettingsTab from './settings-tab' -import AlertsTab from './alerts-tab' -import NetworksTab from './networks-tab' -import AdvancedTab from './advanced-tab' -import InfoTab from './info-tab' -import SecurityTab from './security-tab' -import ContactListTab from './contact-list-tab' +import TabBar from '../../components/app/tab-bar' import { ALERTS_ROUTE, ADVANCED_ROUTE, @@ -26,6 +19,13 @@ import { CONTACT_MY_ACCOUNTS_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, } from '../../helpers/constants/routes' +import SettingsTab from './settings-tab' +import AlertsTab from './alerts-tab' +import NetworksTab from './networks-tab' +import AdvancedTab from './advanced-tab' +import InfoTab from './info-tab' +import SecurityTab from './security-tab' +import ContactListTab from './contact-list-tab' class SettingsPage extends PureComponent { static propTypes = { diff --git a/ui/app/pages/settings/settings.container.js b/ui/app/pages/settings/settings.container.js index e0b3cfbaf..f1881581b 100644 --- a/ui/app/pages/settings/settings.container.js +++ b/ui/app/pages/settings/settings.container.js @@ -1,4 +1,3 @@ -import Settings from './settings.component' import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -24,6 +23,7 @@ import { CONTACT_MY_ACCOUNTS_EDIT_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, } from '../../helpers/constants/routes' +import Settings from './settings.component' const ROUTES_TO_I18N_KEYS = { [GENERAL_ROUTE]: 'general', diff --git a/ui/app/pages/token/fee-card/fee-card.stories.js b/ui/app/pages/token/fee-card/fee-card.stories.js index 3e5b854bc..d29807d99 100644 --- a/ui/app/pages/token/fee-card/fee-card.stories.js +++ b/ui/app/pages/token/fee-card/fee-card.stories.js @@ -1,7 +1,7 @@ import React from 'react' -import FeeCard from './fee-card' import { action } from '@storybook/addon-actions' import { text } from '@storybook/addon-knobs/react' +import FeeCard from './fee-card' const containerStyle = { width: '300px', diff --git a/ui/app/pages/unlock-page/tests/unlock-page.test.js b/ui/app/pages/unlock-page/tests/unlock-page.test.js index ec4eb914d..33ae361ca 100644 --- a/ui/app/pages/unlock-page/tests/unlock-page.test.js +++ b/ui/app/pages/unlock-page/tests/unlock-page.test.js @@ -1,5 +1,5 @@ -import React from 'react' import assert from 'assert' +import React from 'react' import sinon from 'sinon' import { mount } from 'enzyme' import UnlockPage from '../index' diff --git a/ui/app/pages/unlock-page/unlock-page.component.js b/ui/app/pages/unlock-page/unlock-page.component.js index ffaadc5ee..5fffbf399 100644 --- a/ui/app/pages/unlock-page/unlock-page.component.js +++ b/ui/app/pages/unlock-page/unlock-page.component.js @@ -1,9 +1,9 @@ +import { EventEmitter } from 'events' import React, { Component } from 'react' import PropTypes from 'prop-types' import Button from '@material-ui/core/Button' -import TextField from '../../components/ui/text-field' import getCaretCoordinates from 'textarea-caret' -import { EventEmitter } from 'events' +import TextField from '../../components/ui/text-field' import Mascot from '../../components/ui/mascot' import { DEFAULT_ROUTE } from '../../helpers/constants/routes' diff --git a/ui/app/selectors/custom-gas.js b/ui/app/selectors/custom-gas.js index 816242874..8c0c74ab7 100644 --- a/ui/app/selectors/custom-gas.js +++ b/ui/app/selectors/custom-gas.js @@ -1,11 +1,9 @@ +import { addHexPrefix } from 'ethereumjs-util' import { conversionUtil, multiplyCurrencies, conversionGreaterThan, } from '../helpers/utils/conversion-util' -import { - getCurrentCurrency, getIsMainnet, getPreferences, -} from '.' import { formatCurrency, } from '../helpers/utils/confirm-tx.util' @@ -18,9 +16,11 @@ import { import { calcGasTotal, } from '../pages/send/send.utils' -import { addHexPrefix } from 'ethereumjs-util' import { GAS_ESTIMATE_TYPES } from '../helpers/constants/common' +import { + getCurrentCurrency, getIsMainnet, getPreferences, +} from '.' const NUMBER_OF_DECIMALS_SM_BTNS = 5 diff --git a/ui/app/selectors/permissions.js b/ui/app/selectors/permissions.js index 47d7857da..22247e607 100644 --- a/ui/app/selectors/permissions.js +++ b/ui/app/selectors/permissions.js @@ -1,8 +1,8 @@ import { forOwn } from 'lodash' -import { getMetaMaskAccountsOrdered, getOriginOfCurrentTab, getSelectedAddress } from '.' import { CAVEAT_NAMES, } from '../../../app/scripts/controllers/permissions/enums' +import { getMetaMaskAccountsOrdered, getOriginOfCurrentTab, getSelectedAddress } from '.' // selectors diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js index cfa680186..b759ccb9b 100644 --- a/ui/app/selectors/selectors.js +++ b/ui/app/selectors/selectors.js @@ -1,6 +1,6 @@ -import { NETWORK_TYPES } from '../helpers/constants/common' import { stripHexPrefix, addHexPrefix } from 'ethereumjs-util' import { createSelector } from 'reselect' +import { NETWORK_TYPES } from '../helpers/constants/common' import { shortenAddress, checksumAddress, diff --git a/ui/app/selectors/send.js b/ui/app/selectors/send.js index 8244983a5..dd17f90ac 100644 --- a/ui/app/selectors/send.js +++ b/ui/app/selectors/send.js @@ -1,4 +1,5 @@ import abi from 'human-standard-token-abi' +import { calcGasTotal } from '../pages/send/send.utils' import { accountsWithSendEtherInfoSelector, getAddressBook, @@ -6,7 +7,6 @@ import { getTargetAccount, getAveragePriceEstimateInHexWEI, } from '.' -import { calcGasTotal } from '../pages/send/send.utils' export function getBlockGasLimit (state) { return state.metamask.currentBlockGasLimit diff --git a/ui/app/selectors/transactions.js b/ui/app/selectors/transactions.js index f0d63b115..4faa6a91e 100644 --- a/ui/app/selectors/transactions.js +++ b/ui/app/selectors/transactions.js @@ -10,10 +10,10 @@ import { TRANSACTION_TYPE_RETRY, } from '../../../app/scripts/controllers/transactions/enums' import { hexToDecimal } from '../helpers/utils/conversions.util' +import txHelper from '../../lib/tx-helper' import { getSelectedAddress, } from '.' -import txHelper from '../../lib/tx-helper' export const incomingTxListSelector = (state) => { const { showIncomingTransactions } = state.metamask.featureFlags diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index af32443f6..4d9f7a4b3 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -1,26 +1,26 @@ import abi from 'human-standard-token-abi' import pify from 'pify' +import ethUtil from 'ethereumjs-util' +import log from 'loglevel' import getBuyEthUrl from '../../../app/scripts/lib/buy-eth-url' import { checksumAddress } from '../helpers/utils/util' import { calcTokenBalance, estimateGas } from '../pages/send/send.utils' -import ethUtil from 'ethereumjs-util' import { fetchLocale, loadRelativeTimeFormatLocaleData } from '../helpers/utils/i18n-helper' import { getMethodDataAsync } from '../helpers/utils/transactions.util' import { fetchSymbolAndDecimals } from '../helpers/utils/token-util' import switchDirection from '../helpers/utils/switch-direction' -import log from 'loglevel' import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../app/scripts/lib/enums' import { hasUnconfirmedTransactions } from '../helpers/utils/confirm-tx.util' import { setCustomGasLimit } from '../ducks/gas/gas.duck' import txHelper from '../../lib/tx-helper' import { getEnvironmentType } from '../../../app/scripts/lib/util' -import * as actionConstants from './actionConstants' import { getPermittedAccountsForCurrentTab, getSelectedAddress, } from '../selectors' import { switchedToUnconnectedAccount } from '../ducks/alerts/unconnected-account' import { getUnconnectedAccountAlertEnabledness } from '../ducks/metamask/metamask' +import * as actionConstants from './actionConstants' let background = null let promisifiedBackground = null diff --git a/ui/index.js b/ui/index.js index 8131b66cc..41da33b4a 100644 --- a/ui/index.js +++ b/ui/index.js @@ -3,14 +3,14 @@ import log from 'loglevel' import { clone } from 'lodash' import React from 'react' import { render } from 'react-dom' -import Root from './app/pages' -import * as actions from './app/store/actions' -import configureStore from './app/store/store' -import txHelper from './lib/tx-helper' import { getEnvironmentType } from '../app/scripts/lib/util' import { ALERT_TYPES } from '../app/scripts/controllers/alert' import { SENTRY_STATE } from '../app/scripts/lib/setupSentry' import { ENVIRONMENT_TYPE_POPUP } from '../app/scripts/lib/enums' +import Root from './app/pages' +import * as actions from './app/store/actions' +import configureStore from './app/store/store' +import txHelper from './lib/tx-helper' import { fetchLocale, loadRelativeTimeFormatLocaleData } from './app/helpers/utils/i18n-helper' import switchDirection from './app/helpers/utils/switch-direction' import { getPermittedAccountsForCurrentTab, getSelectedAddress } from './app/selectors' diff --git a/ui/lib/icon-factory.js b/ui/lib/icon-factory.js index 077604195..142e7bbfd 100644 --- a/ui/lib/icon-factory.js +++ b/ui/lib/icon-factory.js @@ -1,7 +1,7 @@ let iconFactory import { isValidAddress } from 'ethereumjs-util' -import { checksumAddress } from '../app/helpers/utils/util' import contractMap from 'eth-contract-metadata' +import { checksumAddress } from '../app/helpers/utils/util' export default function iconFactoryGenerator (jazzicon) { if (!iconFactory) { diff --git a/ui/lib/tx-helper.js b/ui/lib/tx-helper.js index 03a7b3e1e..fcb264c0c 100644 --- a/ui/lib/tx-helper.js +++ b/ui/lib/tx-helper.js @@ -1,5 +1,5 @@ -import { valuesFor } from '../app/helpers/utils/util' import log from 'loglevel' +import { valuesFor } from '../app/helpers/utils/util' export default function txHelper (unapprovedTxs, unapprovedMsgs, personalMsgs, decryptMsgs, encryptionPublicKeyMsgs, typedMessages, network) { log.debug('tx-helper called with params:')