From 274a9ecf53cd0326d41a370a37b1b6fd9d9c83d4 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 3 Dec 2019 17:20:55 -0330 Subject: [PATCH] yarn lint --fix --- app/scripts/background.js | 2 +- app/scripts/controllers/app-state.js | 6 +-- app/scripts/controllers/detect-tokens.js | 2 +- .../controllers/network/middleware/pending.js | 4 +- .../permissions/methodMiddleware.js | 2 +- app/scripts/controllers/preferences.js | 4 +- app/scripts/controllers/transactions/index.js | 4 +- .../lib/ens-ipfs/contracts/registry.js | 2 +- .../lib/ens-ipfs/contracts/resolver.js | 2 +- app/scripts/lib/ens-ipfs/resolver.js | 4 +- app/scripts/lib/ens-ipfs/setup.js | 4 +- app/scripts/lib/notification-manager.js | 2 +- app/scripts/metamask-controller.js | 16 +++---- app/scripts/migrations/028.js | 2 +- app/scripts/phishing-detect.js | 2 +- app/scripts/platforms/extension.js | 6 +-- app/scripts/ui.js | 8 ++-- development/selector.js | 2 +- gulpfile.js | 10 ++-- test/e2e/contract-test/contract.js | 4 +- test/e2e/helpers.js | 2 +- test/lib/render-helpers.js | 4 +- .../controllers/balance-controller.spec.js | 2 +- .../app/controllers/detect-tokens-test.js | 10 ++-- .../app/controllers/infura-controller-test.js | 2 +- .../controllers/metamask-controller-test.js | 12 ++--- .../network/pending-middleware-test.js | 4 +- .../preferences-controller-test.js | 42 ++++++++--------- .../transactions/pending-tx-test.js | 4 +- .../transactions/tx-controller-test.js | 22 ++++----- .../transactions/tx-state-manager-test.js | 4 +- test/unit/app/typed-message-manager.spec.js | 18 ++++---- test/unit/migrations/022-test.js | 2 +- test/unit/migrations/023-test.js | 6 +-- test/unit/migrations/026-test.js | 6 +-- test/unit/migrations/027-test.js | 6 +-- test/unit/migrations/028-test.js | 4 +- test/unit/migrations/030-test.js | 4 +- test/unit/migrations/031-test.js | 4 +- test/unit/migrations/migrator-test.js | 4 +- test/unit/ui/app/reducers/app.spec.js | 46 +++++++++---------- test/unit/ui/app/reducers/metamask.spec.js | 2 +- test/unit/ui/app/selectors.spec.js | 2 +- test/web3/schema.js | 2 +- .../add-token-button.component.js | 2 +- .../app/customize-gas-modal/gas-modal-card.js | 2 +- .../app/dropdowns/network-dropdown.js | 2 +- .../app/dropdowns/tests/dropdown.test.js | 2 +- .../advanced-gas-inputs.container.js | 2 +- ...gas-modal-page-container-container.test.js | 2 +- .../gas-price-chart/gas-price-chart.utils.js | 6 +-- .../tests/gas-price-chart.component.test.js | 2 +- .../home-notification.component.js | 2 +- .../account-details-modal.component.js | 2 +- .../cancel-transaction.component.test.js | 4 +- .../deposit-ether-modal.component.js | 4 +- .../app/modals/notification-modal.js | 4 +- .../modals/qr-scanner/qr-scanner.component.js | 10 ++-- ui/app/components/app/network.js | 2 +- .../app/permission-page-container/index.js | 6 +-- .../index.js | 2 +- .../permission-page-container-header/index.js | 2 +- ...mission-page-container-header.component.js | 2 +- .../tests/selected-account-component.test.js | 2 +- .../shift-list-item.container.js | 2 +- .../signature-request.component.js | 2 +- .../transaction-action.component.test.js | 4 +- .../transaction-activity-log.util.js | 2 +- .../transaction-breakdown.container.js | 2 +- ...transaction-list-item-details.component.js | 2 +- .../app/wallet-view/wallet-view.container.js | 2 +- ui/app/components/ui/alert/index.js | 2 +- .../ui/breadcrumbs/breadcrumbs.component.js | 2 +- .../currency-input.component.js | 2 +- .../currency-input.container.js | 2 +- .../tests/error-message.component.test.js | 4 +- .../ui/eth-balance/eth-balance.component.js | 2 +- .../loading-screen.component.js | 2 +- .../ui/lock-icon/lock-icon.component.js | 2 +- ui/app/components/ui/mascot.js | 2 +- .../page-container-header.component.test.js | 2 +- .../ui/spinner/spinner.component.js | 2 +- .../ui/token-input/token-input.container.js | 2 +- ui/app/components/ui/tooltip-v2.js | 6 +-- ui/app/ducks/app/app.js | 4 +- ui/app/ducks/gas/gas-duck.test.js | 36 +++++++-------- ui/app/ducks/gas/gas.duck.js | 2 +- ui/app/ducks/send/send-duck.test.js | 12 ++--- ui/app/helpers/utils/conversion-util.test.js | 2 +- ui/app/helpers/utils/util.js | 2 +- .../confirm-add-suggested-token.container.js | 2 +- ui/app/pages/confirm-transaction/conf-tx.js | 2 +- .../connect-hardware/connect-screen.js | 14 +++--- .../create-account/connect-hardware/index.js | 16 +++---- .../create-account.component.js | 2 +- .../import-with-seed-phrase.component.js | 4 +- .../import-with-seed-phrase.component.test.js | 10 ++-- .../new-account/new-account.component.js | 2 +- .../seed-phrase/seed-phrase.component.js | 2 +- ui/app/pages/keychains/restore-vault.js | 2 +- .../mobile-sync/mobile-sync.component.js | 10 ++-- ui/app/pages/routes/index.js | 2 +- .../add-recipient/add-recipient.component.js | 4 +- .../add-recipient/ens-input.component.js | 2 +- .../tests/add-recipient-utils.test.js | 16 +++---- .../tests/amount-max-button-container.test.js | 2 +- .../send-asset-row.component.js | 2 +- .../send-asset-row.container.js | 2 +- .../gas-fee-display.component.js | 2 +- .../test/gas-fee-display.component.test.js | 4 +- .../send-hex-data-row.component.js | 6 +-- .../send-row-error-message.component.js | 2 +- .../tests/send-row-wrapper-component.test.js | 2 +- .../send/send-footer/send-footer.component.js | 2 +- .../tests/send-footer-selectors.test.js | 4 +- ui/app/pages/send/send.container.js | 2 +- .../pages/send/tests/send-component.test.js | 4 +- .../pages/send/tests/send-container.test.js | 4 +- .../send/tests/send-selectors-test-data.js | 2 +- ui/app/pages/send/tests/send-utils.test.js | 12 ++--- .../advanced-tab/advanced-tab.container.js | 2 +- ui/app/selectors/selectors.js | 2 +- ui/app/selectors/tests/selectors-test-data.js | 2 +- ui/app/store/actions.js | 22 ++++----- ui/index.js | 2 +- ui/lib/feature-toggle-utils.js | 2 +- ui/lib/webcam-utils.js | 4 +- 127 files changed, 324 insertions(+), 324 deletions(-) diff --git a/app/scripts/background.js b/app/scripts/background.js index e5c9ea665..b58be5ebf 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -488,7 +488,7 @@ function openPopup () { } // On first install, open a new tab with MetaMask -extension.runtime.onInstalled.addListener(({reason}) => { +extension.runtime.onInstalled.addListener(({ reason }) => { if ((reason === 'install') && (!METAMASK_DEBUG)) { platform.openExtensionInBrowser() } diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index c60a1c4f5..688062def 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -7,8 +7,8 @@ class AppStateController { * @param opts */ constructor (opts = {}) { - const {initState, onInactiveTimeout, preferencesStore} = opts - const {preferences} = preferencesStore.getState() + const { initState, onInactiveTimeout, preferencesStore } = opts + const { preferences } = preferencesStore.getState() this.onInactiveTimeout = onInactiveTimeout || (() => {}) this.store = new ObservableStore(extend({ @@ -62,7 +62,7 @@ class AppStateController { * @private */ _resetTimer () { - const {timeoutMinutes} = this.store.getState() + const { timeoutMinutes } = this.store.getState() if (this.timer) { clearTimeout(this.timer) diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js index 923aa2d15..3ad39984a 100644 --- a/app/scripts/controllers/detect-tokens.js +++ b/app/scripts/controllers/detect-tokens.js @@ -4,7 +4,7 @@ const { warn } = require('loglevel') const { MAINNET } = require('./network/enums') // By default, poll every 3 minutes const DEFAULT_INTERVAL = 180 * 1000 -const ERC20_ABI = [{'constant': true, 'inputs': [{'name': '_owner', 'type': 'address'}], 'name': 'balanceOf', 'outputs': [{'name': 'balance', 'type': 'uint256'}], 'payable': false, 'type': 'function'}] +const ERC20_ABI = [{ 'constant': true, 'inputs': [{ 'name': '_owner', 'type': 'address' }], 'name': 'balanceOf', 'outputs': [{ 'name': 'balance', 'type': 'uint256' }], 'payable': false, 'type': 'function' }] const SINGLE_CALL_BALANCES_ABI = require('single-call-balance-checker-abi') const SINGLE_CALL_BALANCES_ADDRESS = '0xb1f8e55c7f64d203c1400b9d8555d050f94adf39' /** diff --git a/app/scripts/controllers/network/middleware/pending.js b/app/scripts/controllers/network/middleware/pending.js index 96a5d40be..51c3c3e6d 100644 --- a/app/scripts/controllers/network/middleware/pending.js +++ b/app/scripts/controllers/network/middleware/pending.js @@ -3,7 +3,7 @@ const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware function createPendingNonceMiddleware ({ getPendingNonce }) { return createAsyncMiddleware(async (req, res, next) => { - const {method, params} = req + const { method, params } = req if (method !== 'eth_getTransactionCount') { return next() } @@ -17,7 +17,7 @@ function createPendingNonceMiddleware ({ getPendingNonce }) { function createPendingTxMiddleware ({ getPendingTransactionByHash }) { return createAsyncMiddleware(async (req, res, next) => { - const {method, params} = req + const { method, params } = req if (method !== 'eth_getTransactionByHash') { return next() } diff --git a/app/scripts/controllers/permissions/methodMiddleware.js b/app/scripts/controllers/permissions/methodMiddleware.js index e0b451c9f..06e50cc7f 100644 --- a/app/scripts/controllers/permissions/methodMiddleware.js +++ b/app/scripts/controllers/permissions/methodMiddleware.js @@ -11,7 +11,7 @@ module.exports = function createMethodMiddleware ({ return createAsyncMiddleware(async (req, res, next) => { if (typeof req.method !== 'string') { - res.error = ethErrors.rpc.invalidRequest({ data: req}) + res.error = ethErrors.rpc.invalidRequest({ data: req }) return } diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 409ce6876..907351e87 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -258,7 +258,7 @@ class PreferencesController { const identities = addresses.reduce((ids, address, index) => { const oldId = oldIdentities[address] || {} - ids[address] = {name: `Account ${index + 1}`, address, ...oldId} + ids[address] = { name: `Account ${index + 1}`, address, ...oldId } return ids }, {}) const accountTokens = addresses.reduce((tokens, address) => { @@ -474,7 +474,7 @@ class PreferencesController { throw new Error('setAccountLabel requires a valid address, got ' + String(account)) } const address = normalizeAddress(account) - const {identities} = this.store.getState() + const { identities } = this.store.getState() identities[address] = identities[address] || {} identities[address].name = label this.store.updateState({ identities }) diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 85733aa38..d190b4e52 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -219,7 +219,7 @@ class TransactionController extends EventEmitter { // the specified address const permittedAddresses = await this.getPermittedAccounts(origin) if (!permittedAddresses.includes(normalizedTxParams.from)) { - throw ethErrors.provider.unauthorized({ data: { origin }}) + throw ethErrors.provider.unauthorized({ data: { origin } }) } } @@ -690,7 +690,7 @@ class TransactionController extends EventEmitter { // get the confirmed transactions nonce and from address const txMeta = this.txStateManager.getTx(txId) const { nonce, from } = txMeta.txParams - const sameNonceTxs = this.txStateManager.getFilteredTxList({nonce, from}) + const sameNonceTxs = this.txStateManager.getFilteredTxList({ nonce, from }) if (!sameNonceTxs.length) { return } diff --git a/app/scripts/lib/ens-ipfs/contracts/registry.js b/app/scripts/lib/ens-ipfs/contracts/registry.js index 99ca24458..6b60718a5 100644 --- a/app/scripts/lib/ens-ipfs/contracts/registry.js +++ b/app/scripts/lib/ens-ipfs/contracts/registry.js @@ -1 +1 @@ -module.exports = [{'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'resolver', 'outputs': [{'name': '', 'type': 'address'}], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'owner', 'outputs': [{'name': '', 'type': 'address'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'label', 'type': 'bytes32'}, {'name': 'owner', 'type': 'address'}], 'name': 'setSubnodeOwner', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'ttl', 'type': 'uint64'}], 'name': 'setTTL', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'ttl', 'outputs': [{'name': '', 'type': 'uint64'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'resolver', 'type': 'address'}], 'name': 'setResolver', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'owner', 'type': 'address'}], 'name': 'setOwner', 'outputs': [], 'payable': false, 'type': 'function'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'owner', 'type': 'address'}], 'name': 'Transfer', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': true, 'name': 'label', 'type': 'bytes32'}, {'indexed': false, 'name': 'owner', 'type': 'address'}], 'name': 'NewOwner', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'resolver', 'type': 'address'}], 'name': 'NewResolver', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'ttl', 'type': 'uint64'}], 'name': 'NewTTL', 'type': 'event'}] +module.exports = [{ 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }], 'name': 'resolver', 'outputs': [{ 'name': '', 'type': 'address' }], 'payable': false, 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }], 'name': 'owner', 'outputs': [{ 'name': '', 'type': 'address' }], 'payable': false, 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'label', 'type': 'bytes32' }, { 'name': 'owner', 'type': 'address' }], 'name': 'setSubnodeOwner', 'outputs': [], 'payable': false, 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'ttl', 'type': 'uint64' }], 'name': 'setTTL', 'outputs': [], 'payable': false, 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }], 'name': 'ttl', 'outputs': [{ 'name': '', 'type': 'uint64' }], 'payable': false, 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'resolver', 'type': 'address' }], 'name': 'setResolver', 'outputs': [], 'payable': false, 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'owner', 'type': 'address' }], 'name': 'setOwner', 'outputs': [], 'payable': false, 'type': 'function' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': false, 'name': 'owner', 'type': 'address' }], 'name': 'Transfer', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': true, 'name': 'label', 'type': 'bytes32' }, { 'indexed': false, 'name': 'owner', 'type': 'address' }], 'name': 'NewOwner', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': false, 'name': 'resolver', 'type': 'address' }], 'name': 'NewResolver', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': false, 'name': 'ttl', 'type': 'uint64' }], 'name': 'NewTTL', 'type': 'event' }] diff --git a/app/scripts/lib/ens-ipfs/contracts/resolver.js b/app/scripts/lib/ens-ipfs/contracts/resolver.js index b61fbed88..4ec3885f8 100644 --- a/app/scripts/lib/ens-ipfs/contracts/resolver.js +++ b/app/scripts/lib/ens-ipfs/contracts/resolver.js @@ -1,2 +1,2 @@ module.exports = -[{'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'hash', 'type': 'bytes32'}], 'name': 'setContent', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'content', 'outputs': [{'name': '', 'type': 'bytes32'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'interfaceID', 'type': 'bytes4'}], 'name': 'supportsInterface', 'outputs': [{'name': '', 'type': 'bool'}], 'payable': false, 'stateMutability': 'pure', 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'key', 'type': 'string'}, {'name': 'value', 'type': 'string'}], 'name': 'setText', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'contentTypes', 'type': 'uint256'}], 'name': 'ABI', 'outputs': [{'name': 'contentType', 'type': 'uint256'}, {'name': 'data', 'type': 'bytes'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'x', 'type': 'bytes32'}, {'name': 'y', 'type': 'bytes32'}], 'name': 'setPubkey', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'hash', 'type': 'bytes'}], 'name': 'setContenthash', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'addr', 'outputs': [{'name': '', 'type': 'address'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'key', 'type': 'string'}], 'name': 'text', 'outputs': [{'name': '', 'type': 'string'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'contentType', 'type': 'uint256'}, {'name': 'data', 'type': 'bytes'}], 'name': 'setABI', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'name', 'outputs': [{'name': '', 'type': 'string'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'name', 'type': 'string'}], 'name': 'setName', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'contenthash', 'outputs': [{'name': '', 'type': 'bytes'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'pubkey', 'outputs': [{'name': 'x', 'type': 'bytes32'}, {'name': 'y', 'type': 'bytes32'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'addr', 'type': 'address'}], 'name': 'setAddr', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'inputs': [{'name': 'ensAddr', 'type': 'address'}], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'constructor'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'a', 'type': 'address'}], 'name': 'AddrChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'name', 'type': 'string'}], 'name': 'NameChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': true, 'name': 'contentType', 'type': 'uint256'}], 'name': 'ABIChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'x', 'type': 'bytes32'}, {'indexed': false, 'name': 'y', 'type': 'bytes32'}], 'name': 'PubkeyChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'indexedKey', 'type': 'string'}, {'indexed': false, 'name': 'key', 'type': 'string'}], 'name': 'TextChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'hash', 'type': 'bytes'}], 'name': 'ContenthashChanged', 'type': 'event'}] +[{ 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'hash', 'type': 'bytes32' }], 'name': 'setContent', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }], 'name': 'content', 'outputs': [{ 'name': '', 'type': 'bytes32' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'interfaceID', 'type': 'bytes4' }], 'name': 'supportsInterface', 'outputs': [{ 'name': '', 'type': 'bool' }], 'payable': false, 'stateMutability': 'pure', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'key', 'type': 'string' }, { 'name': 'value', 'type': 'string' }], 'name': 'setText', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'contentTypes', 'type': 'uint256' }], 'name': 'ABI', 'outputs': [{ 'name': 'contentType', 'type': 'uint256' }, { 'name': 'data', 'type': 'bytes' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'x', 'type': 'bytes32' }, { 'name': 'y', 'type': 'bytes32' }], 'name': 'setPubkey', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'hash', 'type': 'bytes' }], 'name': 'setContenthash', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }], 'name': 'addr', 'outputs': [{ 'name': '', 'type': 'address' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'key', 'type': 'string' }], 'name': 'text', 'outputs': [{ 'name': '', 'type': 'string' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'contentType', 'type': 'uint256' }, { 'name': 'data', 'type': 'bytes' }], 'name': 'setABI', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }], 'name': 'name', 'outputs': [{ 'name': '', 'type': 'string' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'name', 'type': 'string' }], 'name': 'setName', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }], 'name': 'contenthash', 'outputs': [{ 'name': '', 'type': 'bytes' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }], 'name': 'pubkey', 'outputs': [{ 'name': 'x', 'type': 'bytes32' }, { 'name': 'y', 'type': 'bytes32' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': 'node', 'type': 'bytes32' }, { 'name': 'addr', 'type': 'address' }], 'name': 'setAddr', 'outputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'name': 'ensAddr', 'type': 'address' }], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'constructor' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': false, 'name': 'a', 'type': 'address' }], 'name': 'AddrChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': false, 'name': 'name', 'type': 'string' }], 'name': 'NameChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': true, 'name': 'contentType', 'type': 'uint256' }], 'name': 'ABIChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': false, 'name': 'x', 'type': 'bytes32' }, { 'indexed': false, 'name': 'y', 'type': 'bytes32' }], 'name': 'PubkeyChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': false, 'name': 'indexedKey', 'type': 'string' }, { 'indexed': false, 'name': 'key', 'type': 'string' }], 'name': 'TextChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': 'node', 'type': 'bytes32' }, { 'indexed': false, 'name': 'hash', 'type': 'bytes' }], 'name': 'ContenthashChanged', 'type': 'event' }] diff --git a/app/scripts/lib/ens-ipfs/resolver.js b/app/scripts/lib/ens-ipfs/resolver.js index 34b1304c1..985f0378c 100644 --- a/app/scripts/lib/ens-ipfs/resolver.js +++ b/app/scripts/lib/ens-ipfs/resolver.js @@ -34,7 +34,7 @@ async function resolveEnsToIpfsContentId ({ provider, name }) { const rawContentHash = contentLookupResult[0] const decodedContentHash = contentHash.decode(rawContentHash) const type = contentHash.getCodec(rawContentHash) - return {type: type, hash: decodedContentHash} + return { type: type, hash: decodedContentHash } } if (isLegacyResolver[0]) { // lookup content id @@ -43,7 +43,7 @@ async function resolveEnsToIpfsContentId ({ provider, name }) { if (hexValueIsEmpty(content)) { throw new Error(`EnsIpfsResolver - no content ID found for name "${name}"`) } - return {type: 'swarm-ns', hash: content.slice(2)} + return { type: 'swarm-ns', hash: content.slice(2) } } throw new Error(`EnsIpfsResolver - the resolver for name "${name}" is not standard, it should either supports contenthash() or content()`) } diff --git a/app/scripts/lib/ens-ipfs/setup.js b/app/scripts/lib/ens-ipfs/setup.js index a00c750a4..a703af5b5 100644 --- a/app/scripts/lib/ens-ipfs/setup.js +++ b/app/scripts/lib/ens-ipfs/setup.js @@ -10,7 +10,7 @@ function setupEnsIpfsResolver ({ provider }) { // install listener const urlPatterns = supportedTopLevelDomains.map(tld => `*://*.${tld}/*`) - extension.webRequest.onErrorOccurred.addListener(webRequestDidFail, { urls: urlPatterns, types: ['main_frame']}) + extension.webRequest.onErrorOccurred.addListener(webRequestDidFail, { urls: urlPatterns, types: ['main_frame'] }) // return api object return { @@ -43,7 +43,7 @@ function setupEnsIpfsResolver ({ provider }) { extension.tabs.update(tabId, { url: `loading.html` }) let url = `https://app.ens.domains/name/${name}` try { - const {type, hash} = await resolveEnsToIpfsContentId({ provider, name }) + const { type, hash } = await resolveEnsToIpfsContentId({ provider, name }) if (type === 'ipfs-ns') { const resolvedUrl = `https://gateway.ipfs.io/ipfs/${hash}${path}${search || ''}${fragment || ''}` try { diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 85177cceb..d79326b52 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -27,7 +27,7 @@ class NotificationManager { // bring focus to existing chrome popup extension.windows.update(popup.id, { focused: true }) } else { - const {screenX, screenY, outerWidth, outerHeight} = window + const { screenX, screenY, outerWidth, outerHeight } = window const notificationTop = Math.round(screenY + (outerHeight / 2) - (NOTIFICATION_HEIGHT / 2)) const notificationLeft = Math.round(screenX + (outerWidth / 2) - (NOTIFICATION_WIDTH / 2)) const cb = (currentPopup) => { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 246ae511d..77a596a57 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -21,7 +21,7 @@ const createSubscriptionManager = require('eth-json-rpc-filters/subscriptionMana const createLoggerMiddleware = require('./lib/createLoggerMiddleware') const createOriginMiddleware = require('./lib/createOriginMiddleware') const providerAsMiddleware = require('eth-json-rpc-middleware/providerAsMiddleware') -const {setupMultiplex} = require('./lib/stream-utils.js') +const { setupMultiplex } = require('./lib/stream-utils.js') const KeyringController = require('eth-keyring-controller') const EnsController = require('./controllers/ens') const NetworkController = require('./controllers/network') @@ -45,9 +45,9 @@ const nodeify = require('./lib/nodeify') const accountImporter = require('./account-import-strategies') const getBuyEthUrl = require('./lib/buy-eth-url') const selectChainId = require('./lib/select-chain-id') -const {Mutex} = require('await-semaphore') -const {version} = require('../manifest.json') -const {BN} = require('ethereumjs-util') +const { Mutex } = require('await-semaphore') +const { version } = require('../manifest.json') +const { BN } = require('ethereumjs-util') const GWEI_BN = new BN('1000000000') const percentile = require('percentile') const seedPhraseVerifier = require('./lib/seed-phrase-verifier') @@ -929,8 +929,8 @@ module.exports = class MetamaskController extends EventEmitter { } }) - const {identities} = this.preferencesController.store.getState() - return {...keyState, identities} + const { identities } = this.preferencesController.store.getState() + return { ...keyState, identities } } /** @@ -1652,8 +1652,8 @@ module.exports = class MetamaskController extends EventEmitter { * @private */ async _onKeyringControllerUpdate (state) { - const {isUnlocked, keyrings} = state - const addresses = keyrings.reduce((acc, {accounts}) => acc.concat(accounts), []) + const { isUnlocked, keyrings } = state + const addresses = keyrings.reduce((acc, { accounts }) => acc.concat(accounts), []) if (!addresses.length) { return diff --git a/app/scripts/migrations/028.js b/app/scripts/migrations/028.js index 9e995ee1a..414128ccd 100644 --- a/app/scripts/migrations/028.js +++ b/app/scripts/migrations/028.js @@ -30,7 +30,7 @@ function transformState (state) { const tokens = newState.PreferencesController.tokens newState.PreferencesController.accountTokens = {} for (const identity in identities) { - newState.PreferencesController.accountTokens[identity] = {'mainnet': tokens} + newState.PreferencesController.accountTokens[identity] = { 'mainnet': tokens } } newState.PreferencesController.tokens = [] } diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index 266e4fc31..e99a5d273 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -3,7 +3,7 @@ const dnode = require('dnode') const { EventEmitter } = require('events') const PortStream = require('extension-port-stream') const extension = require('extensionizer') -const {setupMultiplex} = require('./lib/stream-utils.js') +const { setupMultiplex } = require('./lib/stream-utils.js') const { getEnvironmentType } = require('./lib/util') const ExtensionPlatform = require('./platforms/extension') diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 5ae05d230..62394dba5 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -1,8 +1,8 @@ const extension = require('extensionizer') -const {createExplorerLink: explorerLink} = require('etherscan-link') +const { createExplorerLink: explorerLink } = require('etherscan-link') const { getEnvironmentType, checkForError } = require('../lib/util') -const {ENVIRONMENT_TYPE_BACKGROUND} = require('../lib/enums') +const { ENVIRONMENT_TYPE_BACKGROUND } = require('../lib/enums') class ExtensionPlatform { @@ -94,7 +94,7 @@ class ExtensionPlatform { switchToTab (tabId) { return new Promise((resolve, reject) => { - extension.tabs.update(tabId, {highlighted: true}, (tab) => { + extension.tabs.update(tabId, { highlighted: true }, (tab) => { const err = checkForError() if (err) { reject(err) diff --git a/app/scripts/ui.js b/app/scripts/ui.js index f9a8dc16a..6b0bf6caf 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -13,14 +13,14 @@ const ExtensionPlatform = require('./platforms/extension') const NotificationManager = require('./lib/notification-manager') const notificationManager = new NotificationManager() const setupSentry = require('./lib/setupSentry') -const {EventEmitter} = require('events') +const { EventEmitter } = require('events') const Dnode = require('dnode') const Eth = require('ethjs') const EthQuery = require('eth-query') const urlUtil = require('url') const launchMetaMaskUi = require('../../ui') const StreamProvider = require('web3-stream-provider') -const {setupMultiplex} = require('./lib/stream-utils.js') +const { setupMultiplex } = require('./lib/stream-utils.js') const log = require('loglevel') start().catch(log.error) @@ -96,9 +96,9 @@ async function queryCurrentActiveTab (windowType) { return } - extension.tabs.query({active: true, currentWindow: true}, (tabs) => { + extension.tabs.query({ active: true, currentWindow: true }, (tabs) => { const [activeTab] = tabs - const {title, url} = activeTab + const { title, url } = activeTab const { hostname: origin, protocol } = url ? urlUtil.parse(url) : {} resolve({ title, origin, protocol, url, diff --git a/development/selector.js b/development/selector.js index 01011c710..0f47746e2 100644 --- a/development/selector.js +++ b/development/selector.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types' -import React, {Component} from 'react' +import React, { Component } from 'react' export default class Selector extends Component { state = {} diff --git a/gulpfile.js b/gulpfile.js index d5d74333a..d568ae7ff 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -191,7 +191,7 @@ gulp.task('manifest:production', function () { './dist/chrome/manifest.json', './dist/brave/manifest.json', './dist/opera/manifest.json', - ], {base: './dist/'}) + ], { base: './dist/' }) // Exclude chromereload script in production: .pipe(jsoneditor(function (json) { @@ -208,7 +208,7 @@ gulp.task('manifest:testing', function () { return gulp.src([ './dist/firefox/manifest.json', './dist/chrome/manifest.json', - ], {base: './dist/'}) + ], { base: './dist/' }) // Exclude chromereload script in production: .pipe(jsoneditor(function (json) { @@ -227,7 +227,7 @@ gulp.task('manifest:testing-local', function () { return gulp.src([ './dist/firefox/manifest.json', './dist/chrome/manifest.json', - ], {base: './dist/'}) + ], { base: './dist/' }) .pipe(jsoneditor(function (json) { json.background = { @@ -246,7 +246,7 @@ gulp.task('manifest:dev', function () { return gulp.src([ './dist/firefox/manifest.json', './dist/chrome/manifest.json', - ], {base: './dist/'}) + ], { base: './dist/' }) .pipe(jsoneditor(function (json) { json.background = { @@ -261,7 +261,7 @@ gulp.task('manifest:dev', function () { }) gulp.task('optimize:images', function () { - return gulp.src('./dist/**/images/**', {base: './dist/'}) + return gulp.src('./dist/**/images/**', { base: './dist/' }) .pipe(imagemin()) .pipe(gulp.dest('./dist/', { overwrite: true })) }) diff --git a/test/e2e/contract-test/contract.js b/test/e2e/contract-test/contract.js index 6c3941b9d..38ee72416 100644 --- a/test/e2e/contract-test/contract.js +++ b/test/e2e/contract-test/contract.js @@ -123,7 +123,7 @@ const initialize = () => { } const initializeAccountButtons = () => { - piggybankContract = web3.eth.contract([{'constant': false, 'inputs': [{'name': 'withdrawAmount', 'type': 'uint256'}], 'name': 'withdraw', 'outputs': [{'name': 'remainingBal', 'type': 'uint256'}], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [], 'name': 'owner', 'outputs': [{'name': '', 'type': 'address'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': false, 'inputs': [], 'name': 'deposit', 'outputs': [{'name': '', 'type': 'uint256'}], 'payable': true, 'stateMutability': 'payable', 'type': 'function'}, {'inputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'constructor'}]) + piggybankContract = web3.eth.contract([{ 'constant': false, 'inputs': [{ 'name': 'withdrawAmount', 'type': 'uint256' }], 'name': 'withdraw', 'outputs': [{ 'name': 'remainingBal', 'type': 'uint256' }], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': true, 'inputs': [], 'name': 'owner', 'outputs': [{ 'name': '', 'type': 'address' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': false, 'inputs': [], 'name': 'deposit', 'outputs': [{ 'name': '', 'type': 'uint256' }], 'payable': true, 'stateMutability': 'payable', 'type': 'function' }, { 'inputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'constructor' }]) deployButton.onclick = async () => { contractStatus.innerHTML = 'Deploying' @@ -190,7 +190,7 @@ const initialize = () => { const _tokenName = 'TST' const _decimalUnits = 0 const _tokenSymbol = 'TST' - const humanstandardtokenContract = web3.eth.contract([{'constant': true, 'inputs': [], 'name': 'name', 'outputs': [{'name': '', 'type': 'string'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': false, 'inputs': [{'name': '_spender', 'type': 'address'}, {'name': '_value', 'type': 'uint256'}], 'name': 'approve', 'outputs': [{'name': 'success', 'type': 'bool'}], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [], 'name': 'totalSupply', 'outputs': [{'name': '', 'type': 'uint256'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': false, 'inputs': [{'name': '_from', 'type': 'address'}, {'name': '_to', 'type': 'address'}, {'name': '_value', 'type': 'uint256'}], 'name': 'transferFrom', 'outputs': [{'name': 'success', 'type': 'bool'}], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [], 'name': 'decimals', 'outputs': [{'name': '', 'type': 'uint8'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': true, 'inputs': [], 'name': 'version', 'outputs': [{'name': '', 'type': 'string'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': true, 'inputs': [{'name': '_owner', 'type': 'address'}], 'name': 'balanceOf', 'outputs': [{'name': 'balance', 'type': 'uint256'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': true, 'inputs': [], 'name': 'symbol', 'outputs': [{'name': '', 'type': 'string'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': false, 'inputs': [{'name': '_to', 'type': 'address'}, {'name': '_value', 'type': 'uint256'}], 'name': 'transfer', 'outputs': [{'name': 'success', 'type': 'bool'}], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': false, 'inputs': [{'name': '_spender', 'type': 'address'}, {'name': '_value', 'type': 'uint256'}, {'name': '_extraData', 'type': 'bytes'}], 'name': 'approveAndCall', 'outputs': [{'name': 'success', 'type': 'bool'}], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [{'name': '_owner', 'type': 'address'}, {'name': '_spender', 'type': 'address'}], 'name': 'allowance', 'outputs': [{'name': 'remaining', 'type': 'uint256'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'inputs': [{'name': '_initialAmount', 'type': 'uint256'}, {'name': '_tokenName', 'type': 'string'}, {'name': '_decimalUnits', 'type': 'uint8'}, {'name': '_tokenSymbol', 'type': 'string'}], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'constructor'}, {'payable': false, 'stateMutability': 'nonpayable', 'type': 'fallback'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': '_from', 'type': 'address'}, {'indexed': true, 'name': '_to', 'type': 'address'}, {'indexed': false, 'name': '_value', 'type': 'uint256'}], 'name': 'Transfer', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': '_owner', 'type': 'address'}, {'indexed': true, 'name': '_spender', 'type': 'address'}, {'indexed': false, 'name': '_value', 'type': 'uint256'}], 'name': 'Approval', 'type': 'event'}]) + const humanstandardtokenContract = web3.eth.contract([{ 'constant': true, 'inputs': [], 'name': 'name', 'outputs': [{ 'name': '', 'type': 'string' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': '_spender', 'type': 'address' }, { 'name': '_value', 'type': 'uint256' }], 'name': 'approve', 'outputs': [{ 'name': 'success', 'type': 'bool' }], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': true, 'inputs': [], 'name': 'totalSupply', 'outputs': [{ 'name': '', 'type': 'uint256' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': '_from', 'type': 'address' }, { 'name': '_to', 'type': 'address' }, { 'name': '_value', 'type': 'uint256' }], 'name': 'transferFrom', 'outputs': [{ 'name': 'success', 'type': 'bool' }], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': true, 'inputs': [], 'name': 'decimals', 'outputs': [{ 'name': '', 'type': 'uint8' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': true, 'inputs': [], 'name': 'version', 'outputs': [{ 'name': '', 'type': 'string' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': '_owner', 'type': 'address' }], 'name': 'balanceOf', 'outputs': [{ 'name': 'balance', 'type': 'uint256' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': true, 'inputs': [], 'name': 'symbol', 'outputs': [{ 'name': '', 'type': 'string' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': '_to', 'type': 'address' }, { 'name': '_value', 'type': 'uint256' }], 'name': 'transfer', 'outputs': [{ 'name': 'success', 'type': 'bool' }], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': false, 'inputs': [{ 'name': '_spender', 'type': 'address' }, { 'name': '_value', 'type': 'uint256' }, { 'name': '_extraData', 'type': 'bytes' }], 'name': 'approveAndCall', 'outputs': [{ 'name': 'success', 'type': 'bool' }], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function' }, { 'constant': true, 'inputs': [{ 'name': '_owner', 'type': 'address' }, { 'name': '_spender', 'type': 'address' }], 'name': 'allowance', 'outputs': [{ 'name': 'remaining', 'type': 'uint256' }], 'payable': false, 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'name': '_initialAmount', 'type': 'uint256' }, { 'name': '_tokenName', 'type': 'string' }, { 'name': '_decimalUnits', 'type': 'uint8' }, { 'name': '_tokenSymbol', 'type': 'string' }], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'constructor' }, { 'payable': false, 'stateMutability': 'nonpayable', 'type': 'fallback' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': '_from', 'type': 'address' }, { 'indexed': true, 'name': '_to', 'type': 'address' }, { 'indexed': false, 'name': '_value', 'type': 'uint256' }], 'name': 'Transfer', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'name': '_owner', 'type': 'address' }, { 'indexed': true, 'name': '_spender', 'type': 'address' }, { 'indexed': false, 'name': '_value', 'type': 'uint256' }], 'name': 'Approval', 'type': 'event' }]) return humanstandardtokenContract.new( _initialAmount, diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js index 27de882eb..1f0498525 100644 --- a/test/e2e/helpers.js +++ b/test/e2e/helpers.js @@ -97,7 +97,7 @@ async function setupFetchMocking (driver) { return window.origFetch(...args) } if (window.chrome && window.chrome.webRequest) { - window.chrome.webRequest.onBeforeRequest.addListener(cancelInfuraRequest, {urls: ['https://*.infura.io/*']}, ['blocking']) + window.chrome.webRequest.onBeforeRequest.addListener(cancelInfuraRequest, { urls: ['https://*.infura.io/*'] }, ['blocking']) } function cancelInfuraRequest (requestDetails) { console.log(`fetchMocking - Canceling request: "${requestDetails.url}"`) diff --git a/test/lib/render-helpers.js b/test/lib/render-helpers.js index 81f0e27aa..64ae61cae 100644 --- a/test/lib/render-helpers.js +++ b/test/lib/render-helpers.js @@ -12,14 +12,14 @@ function shallowWithStore (component, store) { const context = { store, } - return shallow(component, {context}) + return shallow(component, { context }) } function mountWithStore (component, store) { const context = { store, } - return mount(component, {context}) + return mount(component, { context }) } function mountWithRouter (node) { diff --git a/test/unit/app/controllers/balance-controller.spec.js b/test/unit/app/controllers/balance-controller.spec.js index 9ef25b95f..dbf12246c 100644 --- a/test/unit/app/controllers/balance-controller.spec.js +++ b/test/unit/app/controllers/balance-controller.spec.js @@ -6,7 +6,7 @@ const BalanceController = require('../../../../app/scripts/controllers/balance') const AccountTracker = require('../../../../app/scripts/lib/account-tracker') const TransactionController = require('../../../../app/scripts/controllers/transactions') const { createTestProviderTools } = require('../../../stub/provider') -const provider = createTestProviderTools({ scaffold: {}}).provider +const provider = createTestProviderTools({ scaffold: {} }).provider const TEST_ADDRESS = '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc' diff --git a/test/unit/app/controllers/detect-tokens-test.js b/test/unit/app/controllers/detect-tokens-test.js index c65ee97ab..5a832050a 100644 --- a/test/unit/app/controllers/detect-tokens-test.js +++ b/test/unit/app/controllers/detect-tokens-test.js @@ -23,7 +23,7 @@ describe('DetectTokensController', () => { .get(/.*/) .reply(200) - keyringMemStore = new ObservableStore({ isUnlocked: false}) + keyringMemStore = new ObservableStore({ isUnlocked: false }) network = new NetworkController() preferences = new PreferencesController({ network }) controller = new DetectTokensController({ preferences: preferences, network: network, keyringMemStore: keyringMemStore }) @@ -90,8 +90,8 @@ describe('DetectTokensController', () => { .returns(preferences.addToken('0xbc86727e770de68b1060c91f6bb6945c73e10388', 'XNK', 18)) await controller.detectNewTokens() - assert.deepEqual(preferences.store.getState().tokens, [{address: '0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', decimals: 8, symbol: 'J8T'}, - {address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK'}]) + assert.deepEqual(preferences.store.getState().tokens, [{ address: '0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', decimals: 8, symbol: 'J8T' }, + { address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK' }]) }) it('should not detect same token while in main network', async () => { @@ -107,8 +107,8 @@ describe('DetectTokensController', () => { .returns(preferences.addToken('0xbc86727e770de68b1060c91f6bb6945c73e10388', 'XNK', 18)) await controller.detectNewTokens() - assert.deepEqual(preferences.store.getState().tokens, [{address: '0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', decimals: 8, symbol: 'J8T'}, - {address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK'}]) + assert.deepEqual(preferences.store.getState().tokens, [{ address: '0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', decimals: 8, symbol: 'J8T' }, + { address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK' }]) }) it('should trigger detect new tokens when change address', async () => { diff --git a/test/unit/app/controllers/infura-controller-test.js b/test/unit/app/controllers/infura-controller-test.js index 316f80378..6047c5f27 100644 --- a/test/unit/app/controllers/infura-controller-test.js +++ b/test/unit/app/controllers/infura-controller-test.js @@ -4,7 +4,7 @@ const InfuraController = require('../../../../app/scripts/controllers/infura') describe('infura-controller', function () { let infuraController, sandbox, networkStatus - const response = {'mainnet': 'degraded', 'ropsten': 'ok', 'kovan': 'ok', 'rinkeby': 'down', 'goerli': 'ok'} + const response = { 'mainnet': 'degraded', 'ropsten': 'ok', 'kovan': 'ok', 'rinkeby': 'down', 'goerli': 'ok' } before(async function () { infuraController = new InfuraController() diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js index a904dec08..7091e015d 100644 --- a/test/unit/app/controllers/metamask-controller-test.js +++ b/test/unit/app/controllers/metamask-controller-test.js @@ -193,8 +193,8 @@ describe('MetaMaskController', function () { recentBlocks: [ { gasPrices: [ '0x3b9aca00', '0x174876e800'] }, { gasPrices: [ '0x3b9aca00', '0x174876e800'] }, - { gasPrices: [ '0x174876e800', '0x174876e800' ]}, - { gasPrices: [ '0x174876e800', '0x174876e800' ]}, + { gasPrices: [ '0x174876e800', '0x174876e800' ] }, + { gasPrices: [ '0x174876e800', '0x174876e800' ] }, ], } }, @@ -610,10 +610,10 @@ describe('MetaMaskController', function () { getNetworkstub.returns(42) metamaskController.txController.txStateManager._saveTxList([ - createTxMeta({ id: 1, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: {from: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc'} }), - createTxMeta({ id: 1, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: {from: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc'} }), + createTxMeta({ id: 1, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: { from: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc' } }), + createTxMeta({ id: 1, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: { from: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc' } }), createTxMeta({ id: 2, status: 'rejected', metamaskNetworkId: 32 }), - createTxMeta({ id: 3, status: 'submitted', metamaskNetworkId: currentNetworkId, txParams: {from: '0xB09d8505E1F4EF1CeA089D47094f5DD3464083d4'} }), + createTxMeta({ id: 3, status: 'submitted', metamaskNetworkId: currentNetworkId, txParams: { from: '0xB09d8505E1F4EF1CeA089D47094f5DD3464083d4' } }), ]) }) @@ -876,7 +876,7 @@ describe('MetaMaskController', function () { }) const oldState = metamaskController.getState() - await metamaskController._onKeyringControllerUpdate({keyrings: []}) + await metamaskController._onKeyringControllerUpdate({ keyrings: [] }) assert.ok(addAddresses.notCalled) assert.ok(syncWithAddresses.notCalled) diff --git a/test/unit/app/controllers/network/pending-middleware-test.js b/test/unit/app/controllers/network/pending-middleware-test.js index ac6f8ad9a..5eba4ae01 100644 --- a/test/unit/app/controllers/network/pending-middleware-test.js +++ b/test/unit/app/controllers/network/pending-middleware-test.js @@ -7,7 +7,7 @@ describe('#createPendingNonceMiddleware', function () { const pendingNonceMiddleware = createPendingNonceMiddleware({ getPendingNonce }) it('should call next if not a eth_getTransactionCount request', (done) => { - const req = {method: 'eth_getBlockByNumber'} + const req = { method: 'eth_getBlockByNumber' } const res = {} pendingNonceMiddleware(req, res, () => done()) }) @@ -50,7 +50,7 @@ describe('#createPendingTxMiddleware', function () { 's': '0x0259b52ee8c58baaa385fb05c3f96116e58de89bcc165cb3bfdfc708672fed8a', } it('should call next if not a eth_getTransactionByHash request', (done) => { - const req = {method: 'eth_getBlockByNumber'} + const req = { method: 'eth_getBlockByNumber' } const res = {} pendingTxMiddleware(req, res, () => done()) }) diff --git a/test/unit/app/controllers/preferences-controller-test.js b/test/unit/app/controllers/preferences-controller-test.js index 7aea39a36..1f6c08598 100644 --- a/test/unit/app/controllers/preferences-controller-test.js +++ b/test/unit/app/controllers/preferences-controller-test.js @@ -9,7 +9,7 @@ describe('preferences controller', function () { let network beforeEach(() => { - network = {providerStore: new ObservableStore({ type: 'mainnet' })} + network = { providerStore: new ObservableStore({ type: 'mainnet' }) } preferencesController = new PreferencesController({ network }) }) @@ -20,7 +20,7 @@ describe('preferences controller', function () { '0x7e57e2', ]) - const {identities} = preferencesController.store.getState() + const { identities } = preferencesController.store.getState() assert.deepEqual(identities, { '0xda22le': { name: 'Account 1', @@ -57,7 +57,7 @@ describe('preferences controller', function () { '0x7e57e277', ]) - const {identities} = preferencesController.store.getState() + const { identities } = preferencesController.store.getState() assert.deepEqual(identities, { '0xda22le77': { name: 'Account 1', @@ -246,7 +246,7 @@ describe('preferences controller', function () { assert.equal(tokens.length, 1, 'one token removed') const [token1] = tokens - assert.deepEqual(token1, {address: '0xb', symbol: 'B', decimals: 5}) + assert.deepEqual(token1, { address: '0xb', symbol: 'B', decimals: 5 }) }) it('should remove a token from its state on corresponding address', async function () { @@ -264,7 +264,7 @@ describe('preferences controller', function () { assert.equal(tokensFirst.length, 1, 'one token removed in account') const [token1] = tokensFirst - assert.deepEqual(token1, {address: '0xb', symbol: 'B', decimals: 5}) + assert.deepEqual(token1, { address: '0xb', symbol: 'B', decimals: 5 }) await preferencesController.setSelectedAddress('0x7e57e3') const tokensSecond = preferencesController.getTokens() @@ -286,7 +286,7 @@ describe('preferences controller', function () { assert.equal(tokensFirst.length, 1, 'one token removed in network') const [token1] = tokensFirst - assert.deepEqual(token1, {address: '0xb', symbol: 'B', decimals: 5}) + assert.deepEqual(token1, { address: '0xb', symbol: 'B', decimals: 5 }) network.providerStore.updateState({ type: 'rinkeby' }) const tokensSecond = preferencesController.getTokens() @@ -347,9 +347,9 @@ describe('preferences controller', function () { const sandbox = sinon.createSandbox() beforeEach(() => { - req = {params: {}} + req = { params: {} } res = {} - asy = {next: () => {}, end: () => {}} + asy = { next: () => {}, end: () => {} } stubNext = sandbox.stub(asy, 'next') stubEnd = sandbox.stub(asy, 'end').returns(0) stubHandleWatchAssetERC20 = sandbox.stub(preferencesController, '_handleWatchAssetERC20') @@ -359,7 +359,7 @@ describe('preferences controller', function () { }) it('shouldn not do anything if method not corresponds', async function () { - const asy = {next: () => {}, end: () => {}} + const asy = { next: () => {}, end: () => {} } const stubNext = sandbox.stub(asy, 'next') const stubEnd = sandbox.stub(asy, 'end').returns(0) req.method = 'metamask' @@ -368,7 +368,7 @@ describe('preferences controller', function () { sandbox.assert.called(stubNext) }) it('should do something if method is supported', async function () { - const asy = {next: () => {}, end: () => {}} + const asy = { next: () => {}, end: () => {} } const stubNext = sandbox.stub(asy, 'next') const stubEnd = sandbox.stub(asy, 'end').returns(0) req.method = 'metamask_watchAsset' @@ -392,7 +392,7 @@ describe('preferences controller', function () { assert.deepEqual(res, {}) }) it('should trigger handle add asset if type supported', async function () { - const asy = {next: () => {}, end: () => {}} + const asy = { next: () => {}, end: () => {} } req.method = 'metamask_watchAsset' req.params.type = 'ERC20' await preferencesController.requestWatchAsset(req, res, asy.next, asy.end) @@ -405,7 +405,7 @@ describe('preferences controller', function () { const sandbox = sinon.createSandbox() beforeEach(() => { - req = {params: {type: 'ERC20'}} + req = { params: { type: 'ERC20' } } }) after(() => { sandbox.restore() @@ -457,42 +457,42 @@ describe('preferences controller', function () { it('should validate ERC20 asset correctly', async function () { const validateSpy = sandbox.spy(preferencesController._validateERC20AssetParams) try { - validateSpy({rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABC', decimals: 0}) + validateSpy({ rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABC', decimals: 0 }) } catch (e) {} assert.equal(validateSpy.threw(), false, 'correct options object') const validateSpyAddress = sandbox.spy(preferencesController._validateERC20AssetParams) try { - validateSpyAddress({symbol: 'ABC', decimals: 0}) + validateSpyAddress({ symbol: 'ABC', decimals: 0 }) } catch (e) {} assert.equal(validateSpyAddress.threw(), true, 'options object with no address') const validateSpySymbol = sandbox.spy(preferencesController._validateERC20AssetParams) try { - validateSpySymbol({rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', decimals: 0}) + validateSpySymbol({ rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', decimals: 0 }) } catch (e) {} assert.equal(validateSpySymbol.threw(), true, 'options object with no symbol') const validateSpyDecimals = sandbox.spy(preferencesController._validateERC20AssetParams) try { - validateSpyDecimals({rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABC'}) + validateSpyDecimals({ rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABC' }) } catch (e) {} assert.equal(validateSpyDecimals.threw(), true, 'options object with no decimals') const validateSpyInvalidSymbol = sandbox.spy(preferencesController._validateERC20AssetParams) try { - validateSpyInvalidSymbol({rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABCDEFGHI', decimals: 0}) + validateSpyInvalidSymbol({ rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABCDEFGHI', decimals: 0 }) } catch (e) {} assert.equal(validateSpyInvalidSymbol.threw(), true, 'options object with invalid symbol') const validateSpyInvalidDecimals1 = sandbox.spy(preferencesController._validateERC20AssetParams) try { - validateSpyInvalidDecimals1({rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABCDEFGHI', decimals: -1}) + validateSpyInvalidDecimals1({ rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABCDEFGHI', decimals: -1 }) } catch (e) {} assert.equal(validateSpyInvalidDecimals1.threw(), true, 'options object with decimals less than zero') const validateSpyInvalidDecimals2 = sandbox.spy(preferencesController._validateERC20AssetParams) try { - validateSpyInvalidDecimals2({rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABCDEFGHI', decimals: 38}) + validateSpyInvalidDecimals2({ rawAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', symbol: 'ABCDEFGHI', decimals: 38 }) } catch (e) {} assert.equal(validateSpyInvalidDecimals2.threw(), true, 'options object with decimals more than 36') const validateSpyInvalidAddress = sandbox.spy(preferencesController._validateERC20AssetParams) try { - validateSpyInvalidAddress({rawAddress: '0x123', symbol: 'ABC', decimals: 0}) + validateSpyInvalidAddress({ rawAddress: '0x123', symbol: 'ABC', decimals: 0 }) } catch (e) {} assert.equal(validateSpyInvalidAddress.threw(), true, 'options object with address invalid') }) @@ -515,7 +515,7 @@ describe('preferences controller', function () { describe('#updateRpc', function () { it('should update the rpcDetails properly', () => { - preferencesController.store.updateState({frequentRpcListDetail: [{}, { rpcUrl: 'test' }, {}]}) + preferencesController.store.updateState({ frequentRpcListDetail: [{}, { rpcUrl: 'test' }, {}] }) preferencesController.updateRpc({ rpcUrl: 'test', chainId: 1 }) preferencesController.updateRpc({ rpcUrl: 'test/1', chainId: 1 }) preferencesController.updateRpc({ rpcUrl: 'test/2', chainId: 1 }) diff --git a/test/unit/app/controllers/transactions/pending-tx-test.js b/test/unit/app/controllers/transactions/pending-tx-test.js index 622a53b18..59b80bda5 100644 --- a/test/unit/app/controllers/transactions/pending-tx-test.js +++ b/test/unit/app/controllers/transactions/pending-tx-test.js @@ -27,7 +27,7 @@ describe('PendingTransactionTracker', function () { id: 2, history: [{}], status: 'submitted', - txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d'}, + txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d' }, } providerResultStub = {} @@ -51,7 +51,7 @@ describe('PendingTransactionTracker', function () { }) pendingTxTracker._getBlock = (blockNumber) => { - return {number: blockNumber, transactions: []} + return { number: blockNumber, transactions: [] } } }) diff --git a/test/unit/app/controllers/transactions/tx-controller-test.js b/test/unit/app/controllers/transactions/tx-controller-test.js index d398c7e04..819965424 100644 --- a/test/unit/app/controllers/transactions/tx-controller-test.js +++ b/test/unit/app/controllers/transactions/tx-controller-test.js @@ -96,15 +96,15 @@ describe('Transaction Controller', function () { 'to': '0xc684832530fcbddae4b4230a47e991ddcec2831d', } txController.txStateManager._saveTxList([ - {id: 0, status: 'confirmed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, - {id: 1, status: 'confirmed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, - {id: 2, status: 'confirmed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, - {id: 3, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, - {id: 4, status: 'rejected', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, - {id: 5, status: 'approved', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, - {id: 6, status: 'signed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, - {id: 7, status: 'submitted', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, - {id: 8, status: 'failed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, + { id: 0, status: 'confirmed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, + { id: 1, status: 'confirmed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, + { id: 2, status: 'confirmed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, + { id: 3, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, + { id: 4, status: 'rejected', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, + { id: 5, status: 'approved', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, + { id: 6, status: 'signed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, + { id: 7, status: 'submitted', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, + { id: 8, status: 'failed', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, ]) }) @@ -226,7 +226,7 @@ describe('Transaction Controller', function () { }) it('should fail if the from address isn\'t the selected address', function (done) { - txController.addUnapprovedTransaction({from: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2'}) + txController.addUnapprovedTransaction({ from: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' }) .then(function () { assert.fail('transaction should not have been added') done() @@ -448,7 +448,7 @@ describe('Transaction Controller', function () { { id: 1, status: 'submitted', metamaskNetworkId: currentNetworkId, txParams, history: [{}] }, ]) - expectedTxParams = Object.assign({}, txParams, { gasPrice: '0xb'}) + expectedTxParams = Object.assign({}, txParams, { gasPrice: '0xb' }) }) afterEach(() => { diff --git a/test/unit/app/controllers/transactions/tx-state-manager-test.js b/test/unit/app/controllers/transactions/tx-state-manager-test.js index 02d6199e9..1d975fcad 100644 --- a/test/unit/app/controllers/transactions/tx-state-manager-test.js +++ b/test/unit/app/controllers/transactions/tx-state-manager-test.js @@ -354,13 +354,13 @@ describe('TransactionStateManager', function () { describe('#_removeTx', function () { it('should remove the transaction from the storage', () => { - txStateManager._saveTxList([ {id: 1} ]) + txStateManager._saveTxList([ { id: 1 } ]) txStateManager._removeTx(1) assert(!txStateManager.getFullTxList().length, 'txList should be empty') }) it('should only remove the transaction with ID 1 from the storage', () => { - txStateManager._saveTxList([ {id: 1}, {id: 2} ]) + txStateManager._saveTxList([ { id: 1 }, { id: 2 } ]) txStateManager._removeTx(1) assert.equal(txStateManager.getFullTxList()[0].id, 2, 'txList should have a id of 2') }) diff --git a/test/unit/app/typed-message-manager.spec.js b/test/unit/app/typed-message-manager.spec.js index 959662b91..f408530a6 100644 --- a/test/unit/app/typed-message-manager.spec.js +++ b/test/unit/app/typed-message-manager.spec.js @@ -28,19 +28,19 @@ describe('Typed Message Manager', () => { data: JSON.stringify({ 'types': { 'EIP712Domain': [ - {'name': 'name', 'type': 'string' }, - {'name': 'version', 'type': 'string' }, - {'name': 'chainId', 'type': 'uint256' }, - {'name': 'verifyingContract', 'type': 'address' }, + { 'name': 'name', 'type': 'string' }, + { 'name': 'version', 'type': 'string' }, + { 'name': 'chainId', 'type': 'uint256' }, + { 'name': 'verifyingContract', 'type': 'address' }, ], 'Person': [ - {'name': 'name', 'type': 'string' }, - {'name': 'wallet', 'type': 'address' }, + { 'name': 'name', 'type': 'string' }, + { 'name': 'wallet', 'type': 'address' }, ], 'Mail': [ - {'name': 'from', 'type': 'Person' }, - {'name': 'to', 'type': 'Person' }, - {'name': 'contents', 'type': 'string' }, + { 'name': 'from', 'type': 'Person' }, + { 'name': 'to', 'type': 'Person' }, + { 'name': 'contents', 'type': 'string' }, ], }, 'primaryType': 'Mail', diff --git a/test/unit/migrations/022-test.js b/test/unit/migrations/022-test.js index f7dd35b08..d6dfdf3ab 100644 --- a/test/unit/migrations/022-test.js +++ b/test/unit/migrations/022-test.js @@ -8,7 +8,7 @@ const storage = { 'transactions': [ { 'status': 'submitted' }, { 'status': 'submitted', 'submittedTime': properTime }, - {'status': 'confirmed'}, + { 'status': 'confirmed' }, ], }, }, diff --git a/test/unit/migrations/023-test.js b/test/unit/migrations/023-test.js index 7c93feefe..59b41a1ef 100644 --- a/test/unit/migrations/023-test.js +++ b/test/unit/migrations/023-test.js @@ -40,17 +40,17 @@ while (transactions.length <= 100) { if (!deletableTxStates.find((s) => s === status)) { nonDeletableCount++ } - transactions.push({status}) + transactions.push({ status }) } while (transactions40.length < 40) { status = txStates[Math.floor(Math.random() * Math.floor(txStates.length - 1))] - transactions40.push({status}) + transactions40.push({ status }) } while (transactions20.length < 20) { status = txStates[Math.floor(Math.random() * Math.floor(txStates.length - 1))] - transactions20.push({status}) + transactions20.push({ status }) } diff --git a/test/unit/migrations/026-test.js b/test/unit/migrations/026-test.js index b3f5470cf..77053357e 100644 --- a/test/unit/migrations/026-test.js +++ b/test/unit/migrations/026-test.js @@ -1,7 +1,7 @@ const assert = require('assert') const migration26 = require('../../../app/scripts/migrations/026') const oldStorage = { - 'meta': {'version': 25}, + 'meta': { 'version': 25 }, 'data': { 'PreferencesController': {}, 'KeyringController': { @@ -19,8 +19,8 @@ describe('migration #26', () => { .then((newStorage) => { const identities = newStorage.data.PreferencesController.identities assert.deepEqual(identities, { - '0x1e77e2': {name: 'Test Account 1', address: '0x1e77e2'}, - '0x7e57e2': {name: 'Test Account 2', address: '0x7e57e2'}, + '0x1e77e2': { name: 'Test Account 1', address: '0x1e77e2' }, + '0x7e57e2': { name: 'Test Account 2', address: '0x7e57e2' }, }) assert.strictEqual(newStorage.data.KeyringController.walletNicknames, undefined) done() diff --git a/test/unit/migrations/027-test.js b/test/unit/migrations/027-test.js index 767243a25..04c450ff6 100644 --- a/test/unit/migrations/027-test.js +++ b/test/unit/migrations/027-test.js @@ -15,9 +15,9 @@ const transactions = [] while (transactions.length < 9) { - transactions.push({status: 'rejected'}) - transactions.push({status: 'unapproved'}) - transactions.push({status: 'approved'}) + transactions.push({ status: 'rejected' }) + transactions.push({ status: 'unapproved' }) + transactions.push({ status: 'approved' }) } diff --git a/test/unit/migrations/028-test.js b/test/unit/migrations/028-test.js index a9c7dcdf1..cd0fa0b89 100644 --- a/test/unit/migrations/028-test.js +++ b/test/unit/migrations/028-test.js @@ -5,7 +5,7 @@ const oldStorage = { 'meta': {}, 'data': { 'PreferencesController': { - 'tokens': [{address: '0xa', symbol: 'A', decimals: 4}, {address: '0xb', symbol: 'B', decimals: 4}], + 'tokens': [{ address: '0xa', symbol: 'A', decimals: 4 }, { address: '0xb', symbol: 'B', decimals: 4 }], 'identities': { '0x6d14': {}, '0x3695': {}, @@ -21,7 +21,7 @@ describe('migration #28', () => { const newTokens = newStorage.data.PreferencesController.tokens const newAccountTokens = newStorage.data.PreferencesController.accountTokens - const testTokens = [{address: '0xa', symbol: 'A', decimals: 4}, {address: '0xb', symbol: 'B', decimals: 4}] + const testTokens = [{ address: '0xa', symbol: 'A', decimals: 4 }, { address: '0xb', symbol: 'B', decimals: 4 }] assert.equal(newTokens.length, 0, 'tokens is expected to have the length of 0') assert.equal(newAccountTokens['0x6d14']['mainnet'].length, 2, 'tokens for address is expected to have the length of 2') assert.equal(newAccountTokens['0x3695']['mainnet'].length, 2, 'tokens for address is expected to have the length of 2') diff --git a/test/unit/migrations/030-test.js b/test/unit/migrations/030-test.js index a8e7b4b32..9a41cacb4 100644 --- a/test/unit/migrations/030-test.js +++ b/test/unit/migrations/030-test.js @@ -15,8 +15,8 @@ const storage = { }, PreferencesController: { frequentRpcListDetail: [ - {chainId: 'fail', nickname: '', rpcUrl: 'http://127.0.0.1:8545', ticker: ''}, - {chainId: '1', nickname: '', rpcUrl: 'https://api.myetherwallet.com/eth', ticker: 'ETH'}, + { chainId: 'fail', nickname: '', rpcUrl: 'http://127.0.0.1:8545', ticker: '' }, + { chainId: '1', nickname: '', rpcUrl: 'https://api.myetherwallet.com/eth', ticker: 'ETH' }, ], }, }, diff --git a/test/unit/migrations/031-test.js b/test/unit/migrations/031-test.js index 4fcd8b9a5..ef101bdcd 100644 --- a/test/unit/migrations/031-test.js +++ b/test/unit/migrations/031-test.js @@ -7,7 +7,7 @@ describe('migration #31', () => { 'meta': {}, 'data': { 'PreferencesController': { - 'tokens': [{address: '0xa', symbol: 'A', decimals: 4}, {address: '0xb', symbol: 'B', decimals: 4}], + 'tokens': [{ address: '0xa', symbol: 'A', decimals: 4 }, { address: '0xb', symbol: 'B', decimals: 4 }], 'identities': { '0x6d14': {}, '0x3695': {}, @@ -36,7 +36,7 @@ describe('migration #31', () => { 'meta': {}, 'data': { 'PreferencesController': { - 'tokens': [{address: '0xa', symbol: 'A', decimals: 4}, {address: '0xb', symbol: 'B', decimals: 4}], + 'tokens': [{ address: '0xa', symbol: 'A', decimals: 4 }, { address: '0xb', symbol: 'B', decimals: 4 }], 'identities': { '0x6d14': {}, '0x3695': {}, diff --git a/test/unit/migrations/migrator-test.js b/test/unit/migrations/migrator-test.js index 9a949def4..0a16282a4 100644 --- a/test/unit/migrations/migrator-test.js +++ b/test/unit/migrations/migrator-test.js @@ -29,7 +29,7 @@ const stubMigrations = [ }, }, ] -const versionedData = {meta: {version: 0}, data: {hello: 'world'}} +const versionedData = { meta: { version: 0 }, data: { hello: 'world' } } const firstTimeState = { meta: { version: 0 }, @@ -62,7 +62,7 @@ describe('Migrator', () => { throw new Error('test') } } ] }) migrator.on('error', () => done()) - migrator.migrateData({ meta: {version: 0} }) + migrator.migrateData({ meta: { version: 0 } }) .then(() => { }).catch(done) }) diff --git a/test/unit/ui/app/reducers/app.spec.js b/test/unit/ui/app/reducers/app.spec.js index 6f8dd920c..58d7983a4 100644 --- a/test/unit/ui/app/reducers/app.spec.js +++ b/test/unit/ui/app/reducers/app.spec.js @@ -32,7 +32,7 @@ describe('App State', () => { it('sets networkd dropdown to false', () => { const dropdown = { networkDropdowopen: true } - const state = {...metamaskState, ...dropdown} + const state = { ...metamaskState, ...dropdown } const newState = reduceApp(state, { type: actions.NETWORK_DROPDOWN_CLOSE, }) @@ -55,8 +55,8 @@ describe('App State', () => { }) it('closes sidebar', () => { - const openSidebar = { sidebar: { isOpen: true }} - const state = {...metamaskState, ...openSidebar} + const openSidebar = { sidebar: { isOpen: true } } + const state = { ...metamaskState, ...openSidebar } const newState = reduceApp(state, { type: actions.SIDEBAR_CLOSE, @@ -77,7 +77,7 @@ describe('App State', () => { it('closes alert', () => { const alert = { alertOpen: true, alertMessage: 'test message' } - const state = {...metamaskState, ...alert} + const state = { ...metamaskState, ...alert } const newState = reduceApp(state, { type: actions.ALERT_CLOSE, }) @@ -451,7 +451,7 @@ describe('App State', () => { }, } const oldState = { - metamask: {...metamaskState.metamask, ...txs}, + metamask: { ...metamaskState.metamask, ...txs }, } const state = reduceApp(oldState, { type: actions.SHOW_CONF_TX_PAGE, @@ -480,7 +480,7 @@ describe('App State', () => { } const oldState = { - metamask: {...metamaskState, ...msgs}, + metamask: { ...metamaskState, ...msgs }, } const state = reduceApp(oldState, { @@ -508,7 +508,7 @@ describe('App State', () => { } const oldState = { - metamask: {...metamaskState, ...txs}, + metamask: { ...metamaskState, ...txs }, } const state = reduceApp(oldState, { @@ -538,8 +538,8 @@ describe('App State', () => { it('proceeds to change current view context in confTx', () => { const oldState = { - metamask: {metamaskState}, - appState: {currentView: {context: 0}}, + metamask: { metamaskState }, + appState: { currentView: { context: 0 } }, } const state = reduceApp(oldState, { @@ -565,7 +565,7 @@ describe('App State', () => { const oldState = { - metamask: {...metamaskState, ...txs}, + metamask: { ...metamaskState, ...txs }, } const state = reduceApp(oldState, { @@ -592,7 +592,7 @@ describe('App State', () => { const oldState = { - metamask: {...metamaskState, ...txs}, + metamask: { ...metamaskState, ...txs }, } const state = reduceApp(oldState, { @@ -633,7 +633,7 @@ describe('App State', () => { it('sets warning to empty string when unlock succeeds', () => { const errorState = { warning: 'errors' } - const oldState = {...metamaskState, ...errorState} + const oldState = { ...metamaskState, ...errorState } const state = reduceApp(oldState, { type: actions.UNLOCK_SUCCEEDED, }) @@ -668,8 +668,8 @@ describe('App State', () => { }) it('hides loading message', () => { - const loadingState = { isLoading: true} - const oldState = {...metamaskState, ...loadingState} + const loadingState = { isLoading: true } + const oldState = { ...metamaskState, ...loadingState } const state = reduceApp(oldState, { type: actions.HIDE_LOADING, @@ -687,7 +687,7 @@ describe('App State', () => { }) it('hides sub loading indicator', () => { - const oldState = {...metamaskState, isSubLoading: true } + const oldState = { ...metamaskState, isSubLoading: true } const state = reduceApp(oldState, { type: actions.HIDE_SUB_LOADING_INDICATION, }) @@ -706,8 +706,8 @@ describe('App State', () => { }) it('hides warning', () => { - const displayWarningState = { warning: 'warning'} - const oldState = {...metamaskState, ...displayWarningState} + const displayWarningState = { warning: 'warning' } + const oldState = { ...metamaskState, ...displayWarningState } const state = reduceApp(oldState, { type: actions.HIDE_WARNING, }) @@ -732,7 +732,7 @@ describe('App State', () => { accountExport: 'progress', }, } - const oldState = {...metamaskState, ...requestAccountExportState} + const oldState = { ...metamaskState, ...requestAccountExportState } const state = reduceApp(oldState, { type: actions.EXPORT_ACCOUNT, }) @@ -789,7 +789,7 @@ describe('App State', () => { }, }, } - const oldState = {...metamaskState, ...appState} + const oldState = { ...metamaskState, ...appState } const state = reduceApp(oldState, { type: actions.COINBASE_SUBVIEW, }) @@ -830,7 +830,7 @@ describe('App State', () => { }, } - const oldState = {...metamaskState, ...appState} + const oldState = { ...metamaskState, ...appState } const state = reduceApp(oldState, { type: actions.SHAPESHIFT_SUBVIEW, @@ -881,7 +881,7 @@ describe('App State', () => { maxLimit: 0.76617432, } - const oldState = {...metamaskState, ...appState} + const oldState = { ...metamaskState, ...appState } const state = reduceApp(oldState, { type: actions.PAIR_UPDATE, @@ -922,7 +922,7 @@ describe('App State', () => { }, } - const oldState = {...metamaskState, ...appState} + const oldState = { ...metamaskState, ...appState } const state = reduceApp(oldState, { type: actions.SHOW_QR_VIEW, value: { @@ -957,7 +957,7 @@ describe('App State', () => { it('unsets gas loading', () => { const gasLoadingState = { gasIsLoading: true } - const oldState = {...metamaskState, ...gasLoadingState} + const oldState = { ...metamaskState, ...gasLoadingState } const state = reduceApp(oldState, { type: actions.GAS_LOADING_FINISHED, }) diff --git a/test/unit/ui/app/reducers/metamask.spec.js b/test/unit/ui/app/reducers/metamask.spec.js index 6b3dd7193..ef28de5cf 100644 --- a/test/unit/ui/app/reducers/metamask.spec.js +++ b/test/unit/ui/app/reducers/metamask.spec.js @@ -5,7 +5,7 @@ import * as actions from '../../../../../ui/app/store/actions' describe('MetaMask Reducers', () => { it('init state', () => { - const initState = reduceMetamask({metamask: {}}, {}) + const initState = reduceMetamask({ metamask: {} }, {}) assert(initState) }) diff --git a/test/unit/ui/app/selectors.spec.js b/test/unit/ui/app/selectors.spec.js index cc8e3e9f1..caa040c64 100644 --- a/test/unit/ui/app/selectors.spec.js +++ b/test/unit/ui/app/selectors.spec.js @@ -4,7 +4,7 @@ const mockState = require('../../../data/mock-state.json') const Eth = require('ethjs') const { createTestProviderTools } = require('../../../stub/provider') -const provider = createTestProviderTools({ scaffold: {}}).provider +const provider = createTestProviderTools({ scaffold: {} }).provider describe('Selectors', function () { diff --git a/test/web3/schema.js b/test/web3/schema.js index 9dc528a57..54a6ff1a9 100644 --- a/test/web3/schema.js +++ b/test/web3/schema.js @@ -30,7 +30,7 @@ const params = { value: '0x9184e72a', data: '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675', }, - filterGetLogs: [{'blockHash': '0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70', 'topics': ['0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80']}], + filterGetLogs: [{ 'blockHash': '0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70', 'topics': ['0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80'] }], block: { __required: [], number: 'Q', 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 10887aed8..7a8e75304 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,5 +1,5 @@ import PropTypes from 'prop-types' -import React, {PureComponent} from 'react' +import React, { PureComponent } from 'react' export default class AddTokenButton extends PureComponent { static contextTypes = { diff --git a/ui/app/components/app/customize-gas-modal/gas-modal-card.js b/ui/app/components/app/customize-gas-modal/gas-modal-card.js index 5ba96dd82..117e92c5b 100644 --- a/ui/app/components/app/customize-gas-modal/gas-modal-card.js +++ b/ui/app/components/app/customize-gas-modal/gas-modal-card.js @@ -1,4 +1,4 @@ -import React, {Component} from 'react' +import React, { Component } from 'react' const inherits = require('util').inherits const InputNumber = require('../input-number.js') diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index cf56919c4..12a51ee7d 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types' -import React, {Component} from 'react' +import React, { Component } from 'react' const inherits = require('util').inherits const connect = require('react-redux').connect const { withRouter } = require('react-router-dom') diff --git a/ui/app/components/app/dropdowns/tests/dropdown.test.js b/ui/app/components/app/dropdowns/tests/dropdown.test.js index f7c1e31b1..4eb26ec59 100644 --- a/ui/app/components/app/dropdowns/tests/dropdown.test.js +++ b/ui/app/components/app/dropdowns/tests/dropdown.test.js @@ -13,7 +13,7 @@ describe('Dropdown', () => { wrapper = shallow( diff --git a/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js b/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js index 4fa0d4d94..6b547abc6 100644 --- a/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js +++ b/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js @@ -23,7 +23,7 @@ const mapDispatchToProps = dispatch => { } const mergeProps = (stateProps, dispatchProps, ownProps) => { - const {customGasPrice, customGasLimit, updateCustomGasPrice, updateCustomGasLimit} = ownProps + const { customGasPrice, customGasLimit, updateCustomGasPrice, updateCustomGasLimit } = ownProps return { ...ownProps, ...stateProps, diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js index 8e3d14ea4..aa9e64eaf 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js @@ -249,7 +249,7 @@ describe('gas-modal-page-container container', () => { ] let result - tests.forEach(({ mockState, mockOwnProps, expectedResult}) => { + tests.forEach(({ mockState, mockOwnProps, expectedResult }) => { result = mapStateToProps(mockState, mockOwnProps) assert.deepEqual(result, expectedResult) }) diff --git a/ui/app/components/app/gas-customization/gas-price-chart/gas-price-chart.utils.js b/ui/app/components/app/gas-customization/gas-price-chart/gas-price-chart.utils.js index 452544abe..02f018995 100644 --- a/ui/app/components/app/gas-customization/gas-price-chart/gas-price-chart.utils.js +++ b/ui/app/components/app/gas-customization/gas-price-chart/gas-price-chart.utils.js @@ -190,7 +190,7 @@ export function generateChart (gasPrices, estimatedTimes, gasPricesMax, estimate transition: { duration: 0, }, - padding: {left: 20, right: 15, top: 6, bottom: 10}, + padding: { left: 20, right: 15, top: 6, bottom: 10 }, data: { x: 'x', columns: [ @@ -218,14 +218,14 @@ export function generateChart (gasPrices, estimatedTimes, gasPricesMax, estimate return val + ' GWEI' }, }, - padding: {left: gasPricesMax / 50, right: gasPricesMax / 50}, + padding: { left: gasPricesMax / 50, right: gasPricesMax / 50 }, label: { text: 'Gas Price ($)', position: 'outer-center', }, }, y: { - padding: {top: 7, bottom: 7}, + padding: { top: 7, bottom: 7 }, tick: { values: [Math.floor(estimatedTimesMax * 0.05), Math.ceil(estimatedTimesMax * 0.97)], outer: false, 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 c960f49a7..9ac60770a 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 @@ -97,7 +97,7 @@ describe('GasPriceChart Component', function () { assert(GasPriceChart.prototype.renderChart.callCount, 1) wrapper.instance().componentDidMount() assert(GasPriceChart.prototype.renderChart.callCount, 2) - assert.deepEqual(GasPriceChart.prototype.renderChart.getCall(1).args, [{...testProps}]) + assert.deepEqual(GasPriceChart.prototype.renderChart.getCall(1).args, [{ ...testProps }]) }) }) diff --git a/ui/app/components/app/home-notification/home-notification.component.js b/ui/app/components/app/home-notification/home-notification.component.js index d3d0a0961..b17622e79 100644 --- a/ui/app/components/app/home-notification/home-notification.component.js +++ b/ui/app/components/app/home-notification/home-notification.component.js @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react' import classnames from 'classnames' -import {Tooltip as ReactTippy} from 'react-tippy' +import { Tooltip as ReactTippy } from 'react-tippy' import PropTypes from 'prop-types' import Button from '../../ui/button' diff --git a/ui/app/components/app/modals/account-details-modal/account-details-modal.component.js b/ui/app/components/app/modals/account-details-modal/account-details-modal.component.js index b2ed1a8cc..d47401fb6 100644 --- a/ui/app/components/app/modals/account-details-modal/account-details-modal.component.js +++ b/ui/app/components/app/modals/account-details-modal/account-details-modal.component.js @@ -1,4 +1,4 @@ -import React, { Component} from 'react' +import React, { Component } from 'react' import PropTypes from 'prop-types' import AccountModalContainer from '../account-modal-container' import genAccountLink from '../../../../../lib/account-link.js' 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 345951b0f..6c3d118ee 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 @@ -14,7 +14,7 @@ describe('CancelTransaction Component', () => { , - { context: { t }} + { context: { t } } ) assert.ok(wrapper) @@ -36,7 +36,7 @@ describe('CancelTransaction Component', () => { hideModal={hideModalSpy} showTransactionConfirmedModal={() => {}} />, - { context: { t }} + { context: { t } } ) assert.equal(wrapper.find(Modal).length, 1) diff --git a/ui/app/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js b/ui/app/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js index d503d950e..1e6715ef8 100644 --- a/ui/app/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js +++ b/ui/app/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types' -import React, {Component} from 'react' -import {getNetworkDisplayName} from '../../../../../../app/scripts/controllers/network/util' +import React, { Component } from 'react' +import { getNetworkDisplayName } from '../../../../../../app/scripts/controllers/network/util' import Button from '../../../ui/button' export default class DepositEtherModal extends Component { diff --git a/ui/app/components/app/modals/notification-modal.js b/ui/app/components/app/modals/notification-modal.js index 800cd4f2f..ac7af6140 100644 --- a/ui/app/components/app/modals/notification-modal.js +++ b/ui/app/components/app/modals/notification-modal.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types' -import React, {Component} from 'react' -import {connect} from 'react-redux' +import React, { Component } from 'react' +import { connect } from 'react-redux' import { hideModal } from '../../../store/actions' class NotificationModal extends Component { diff --git a/ui/app/components/app/modals/qr-scanner/qr-scanner.component.js b/ui/app/components/app/modals/qr-scanner/qr-scanner.component.js index 7accf0e58..3fd08d906 100644 --- a/ui/app/components/app/modals/qr-scanner/qr-scanner.component.js +++ b/ui/app/components/app/modals/qr-scanner/qr-scanner.component.js @@ -81,12 +81,12 @@ export default class QrScanner extends Component { this.props.qrCodeDetected(result) this.stopAndClose() } else { - this.setState({msg: this.context.t('unknownQrCode')}) + this.setState({ msg: this.context.t('unknownQrCode') }) } }) .catch(err => { if (err && err.name === 'NotAllowedError') { - this.setState({msg: this.context.t('youNeedToAllowCameraAccess')}) + this.setState({ msg: this.context.t('youNeedToAllowCameraAccess') }) clearTimeout(this.permissionChecker) this.needsToReinit = true this.checkPermisisions() @@ -110,16 +110,16 @@ export default class QrScanner extends Component { if (content.split('ethereum:').length > 1) { type = 'address' - values = {'address': content.split('ethereum:')[1] } + values = { 'address': content.split('ethereum:')[1] } // Regular ethereum addresses - fox ex. 0x.....1111 } else if (content.substring(0, 2).toLowerCase() === '0x') { type = 'address' - values = {'address': content } + values = { 'address': content } } - return {type, values} + return { type, values } } diff --git a/ui/app/components/app/network.js b/ui/app/components/app/network.js index 88204aef7..62251dcfc 100644 --- a/ui/app/components/app/network.js +++ b/ui/app/components/app/network.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types' -import React, {Component} from 'react' +import React, { Component } from 'react' const classnames = require('classnames') const inherits = require('util').inherits diff --git a/ui/app/components/app/permission-page-container/index.js b/ui/app/components/app/permission-page-container/index.js index ea3b8daaa..63e8265c2 100644 --- a/ui/app/components/app/permission-page-container/index.js +++ b/ui/app/components/app/permission-page-container/index.js @@ -1,3 +1,3 @@ -export {default} from './permission-page-container.container' -export {default as PermissionPageContainerContent} from './permission-page-container-content' -export {default as PermissionPageContainerHeader} from './permission-page-container-header' +export { default } from './permission-page-container.container' +export { default as PermissionPageContainerContent } from './permission-page-container-content' +export { default as PermissionPageContainerHeader } from './permission-page-container-header' diff --git a/ui/app/components/app/permission-page-container/permission-page-container-content/index.js b/ui/app/components/app/permission-page-container/permission-page-container-content/index.js index 899d168f9..014e4ff59 100644 --- a/ui/app/components/app/permission-page-container/permission-page-container-content/index.js +++ b/ui/app/components/app/permission-page-container/permission-page-container-content/index.js @@ -1 +1 @@ -export {default} from './permission-page-container-content.component' +export { default } from './permission-page-container-content.component' diff --git a/ui/app/components/app/permission-page-container/permission-page-container-header/index.js b/ui/app/components/app/permission-page-container/permission-page-container-header/index.js index 45ef9036b..d57a5370b 100644 --- a/ui/app/components/app/permission-page-container/permission-page-container-header/index.js +++ b/ui/app/components/app/permission-page-container/permission-page-container-header/index.js @@ -1 +1 @@ -export {default} from './permission-page-container-header.component' +export { default } from './permission-page-container-header.component' diff --git a/ui/app/components/app/permission-page-container/permission-page-container-header/permission-page-container-header.component.js b/ui/app/components/app/permission-page-container/permission-page-container-header/permission-page-container-header.component.js index 8ba3444ba..bf314b994 100644 --- a/ui/app/components/app/permission-page-container/permission-page-container-header/permission-page-container-header.component.js +++ b/ui/app/components/app/permission-page-container/permission-page-container-header/permission-page-container-header.component.js @@ -1,4 +1,4 @@ -import React, {PureComponent} from 'react' +import React, { PureComponent } from 'react' import NetworkDisplay from '../../network-display' export default class PermissionPageContainerHeader extends PureComponent { 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 42e5c8f1b..7db5c7202 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 @@ -10,7 +10,7 @@ describe('SelectedAccount Component', () => { selectedAddress="0x1b82543566f41a7db9a9a75fc933c340ffb55c9d" selectedIdentity={{ name: 'testName' }} /> - ), { context: { t: () => {}}}) + ), { context: { t: () => {} } }) // Checksummed version of address is displayed assert.equal(wrapper.find('.selected-account__address').text(), '0x1B82...5C9D') assert.equal(wrapper.find('.selected-account__name').text(), 'testName') diff --git a/ui/app/components/app/shift-list-item/shift-list-item.container.js b/ui/app/components/app/shift-list-item/shift-list-item.container.js index 1d7645dfd..6dcfab844 100644 --- a/ui/app/components/app/shift-list-item/shift-list-item.container.js +++ b/ui/app/components/app/shift-list-item/shift-list-item.container.js @@ -1,4 +1,4 @@ -import {connect} from 'react-redux' +import { connect } from 'react-redux' import ShiftListItem from './shift-list-item.component' function mapStateToProps (state) { 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 b108c02c4..3abfbd770 100644 --- a/ui/app/components/app/signature-request/signature-request.component.js +++ b/ui/app/components/app/signature-request/signature-request.component.js @@ -51,7 +51,7 @@ export default class SignatureRequest extends PureComponent { render () { const { selectedAccount, - txData: { msgParams: { data, origin, from: senderWallet }}, + txData: { msgParams: { data, origin, from: senderWallet } }, cancel, sign, } = this.props 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 f97e81d15..636fcfdcd 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 @@ -41,7 +41,7 @@ describe('TransactionAction Component', () => { transaction={transaction} className="transaction-action" /> - ), { context: { t }}) + ), { context: { t } }) assert.equal(wrapper.find('.transaction-action').length, 1) wrapper.setState({ transactionAction: 'sentEther' }) @@ -108,7 +108,7 @@ describe('TransactionAction Component', () => { transaction={transaction} className="test-class" />, - { context: { t }} + { context: { t } } ) assert.ok(wrapper) 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 b74513879..b1ab275ed 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 @@ -55,7 +55,7 @@ export function getActivities (transaction, isFirstTransaction = false) { id, hash, history = [], - txParams: { gas: paramsGasLimit, gasPrice: paramsGasPrice}, + txParams: { gas: paramsGasLimit, gasPrice: paramsGasPrice }, xReceipt: { status } = {}, type, } = transaction 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 82f377358..689a60208 100644 --- a/ui/app/components/app/transaction-breakdown/transaction-breakdown.container.js +++ b/ui/app/components/app/transaction-breakdown/transaction-breakdown.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import TransactionBreakdown from './transaction-breakdown.component' -import {getIsMainnet, getNativeCurrency, preferencesSelector} from '../../../selectors/selectors' +import { getIsMainnet, getNativeCurrency, preferencesSelector } from '../../../selectors/selectors' import { getHexGasTotal } from '../../../helpers/utils/confirm-tx.util' import { sumHexes } from '../../../helpers/utils/transactions.util' diff --git a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.component.js b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.component.js index f3bd51b93..29634e023 100644 --- a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.component.js +++ b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.component.js @@ -71,7 +71,7 @@ export default class TransactionListItemDetails extends PureComponent { } handleCopyTxId = () => { - const { transactionGroup} = this.props + const { transactionGroup } = this.props const { primaryTransaction: transaction } = transactionGroup const { hash } = transaction diff --git a/ui/app/components/app/wallet-view/wallet-view.container.js b/ui/app/components/app/wallet-view/wallet-view.container.js index 1e37bc2a8..29790f9a3 100644 --- a/ui/app/components/app/wallet-view/wallet-view.container.js +++ b/ui/app/components/app/wallet-view/wallet-view.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'recompose' import WalletView from './wallet-view.component' -import {showSendPage, hideSidebar, setSelectedToken, showAddTokenPage} from '../../../store/actions' +import { showSendPage, hideSidebar, setSelectedToken, showAddTokenPage } from '../../../store/actions' import { getMetaMaskAccounts, getSelectedAddress, getSelectedAccount } from '../../../selectors/selectors' function mapStateToProps (state) { diff --git a/ui/app/components/ui/alert/index.js b/ui/app/components/ui/alert/index.js index 7d09de3cb..63b537484 100644 --- a/ui/app/components/ui/alert/index.js +++ b/ui/app/components/ui/alert/index.js @@ -32,7 +32,7 @@ class Alert extends Component { }) setTimeout(_ => { - this.setState({visible: false}) + this.setState({ visible: false }) }, 500) } diff --git a/ui/app/components/ui/breadcrumbs/breadcrumbs.component.js b/ui/app/components/ui/breadcrumbs/breadcrumbs.component.js index 6644836db..c407e4ead 100644 --- a/ui/app/components/ui/breadcrumbs/breadcrumbs.component.js +++ b/ui/app/components/ui/breadcrumbs/breadcrumbs.component.js @@ -19,7 +19,7 @@ export default class Breadcrumbs extends PureComponent {
)) } diff --git a/ui/app/components/ui/currency-input/currency-input.component.js b/ui/app/components/ui/currency-input/currency-input.component.js index f7db2b829..18289d4e4 100644 --- a/ui/app/components/ui/currency-input/currency-input.component.js +++ b/ui/app/components/ui/currency-input/currency-input.component.js @@ -79,7 +79,7 @@ export default class CurrencyInput extends PureComponent { swap = () => { const { isSwapped, decimalValue } = this.state - this.setState({isSwapped: !isSwapped}, () => { + this.setState({ isSwapped: !isSwapped }, () => { this.handleChange(decimalValue) }) } 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 46e70bace..0c76d6ce5 100644 --- a/ui/app/components/ui/currency-input/currency-input.container.js +++ b/ui/app/components/ui/currency-input/currency-input.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import CurrencyInput from './currency-input.component' import { ETH } from '../../../helpers/constants/common' import { getMaxModeOn } from '../../../pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors' -import {getIsMainnet, preferencesSelector} from '../../../selectors/selectors' +import { getIsMainnet, preferencesSelector } from '../../../selectors/selectors' const mapStateToProps = state => { const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = state 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 8c5347173..b4dcbde32 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 @@ -11,7 +11,7 @@ describe('ErrorMessage Component', () => { , - { context: { t }} + { context: { t } } ) assert.ok(wrapper) @@ -25,7 +25,7 @@ describe('ErrorMessage Component', () => { , - { context: { t }} + { context: { t } } ) assert.ok(wrapper) diff --git a/ui/app/components/ui/eth-balance/eth-balance.component.js b/ui/app/components/ui/eth-balance/eth-balance.component.js index 925395602..a79b7a198 100644 --- a/ui/app/components/ui/eth-balance/eth-balance.component.js +++ b/ui/app/components/ui/eth-balance/eth-balance.component.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types' -import React, {Component} from 'react' +import React, { Component } from 'react' const { formatBalance, diff --git a/ui/app/components/ui/loading-screen/loading-screen.component.js b/ui/app/components/ui/loading-screen/loading-screen.component.js index b3fb3308d..ec8fb1d33 100644 --- a/ui/app/components/ui/loading-screen/loading-screen.component.js +++ b/ui/app/components/ui/loading-screen/loading-screen.component.js @@ -1,4 +1,4 @@ -import React, {Component} from 'react' +import React, { Component } from 'react' const PropTypes = require('prop-types') const Spinner = require('../spinner') diff --git a/ui/app/components/ui/lock-icon/lock-icon.component.js b/ui/app/components/ui/lock-icon/lock-icon.component.js index d010cb6b2..7724b75dd 100644 --- a/ui/app/components/ui/lock-icon/lock-icon.component.js +++ b/ui/app/components/ui/lock-icon/lock-icon.component.js @@ -12,7 +12,7 @@ export default function LockIcon (props) { width="401.998px" height="401.998px" viewBox="0 0 401.998 401.998" - style={{enableBackground: 'new 0 0 401.998 401.998'}} + style={{ enableBackground: 'new 0 0 401.998 401.998' }} xmlSpace="preserve" {...props} > diff --git a/ui/app/components/ui/mascot.js b/ui/app/components/ui/mascot.js index f84961745..368e10634 100644 --- a/ui/app/components/ui/mascot.js +++ b/ui/app/components/ui/mascot.js @@ -6,7 +6,7 @@ const debounce = require('debounce') module.exports = Mascot inherits(Mascot, Component) -function Mascot ({width = '200', height = '200'}) { +function Mascot ({ width = '200', height = '200' }) { Component.call(this) this.logo = metamaskLogo({ followMouse: true, 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 c3a43b91d..625dcb890 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 @@ -8,7 +8,7 @@ describe('Page Container Header', () => { let wrapper, style, onBackButtonClick, onClose beforeEach(() => { - style = {test: 'style'} + style = { test: 'style' } onBackButtonClick = sinon.spy() onClose = sinon.spy() diff --git a/ui/app/components/ui/spinner/spinner.component.js b/ui/app/components/ui/spinner/spinner.component.js index b9a2eb52a..2936287de 100644 --- a/ui/app/components/ui/spinner/spinner.component.js +++ b/ui/app/components/ui/spinner/spinner.component.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types' const Spinner = ({ className = '', color = '#000000' }) => { return (
- + 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 981cb3598..8c867e8e6 100644 --- a/ui/app/components/ui/token-input/token-input.container.js +++ b/ui/app/components/ui/token-input/token-input.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import TokenInput from './token-input.component' -import {getIsMainnet, getSelectedToken, getSelectedTokenExchangeRate, preferencesSelector} from '../../../selectors/selectors' +import { getIsMainnet, getSelectedToken, getSelectedTokenExchangeRate, preferencesSelector } from '../../../selectors/selectors' const mapStateToProps = state => { const { metamask: { currentCurrency } } = state diff --git a/ui/app/components/ui/tooltip-v2.js b/ui/app/components/ui/tooltip-v2.js index c7f94506c..24518d392 100644 --- a/ui/app/components/ui/tooltip-v2.js +++ b/ui/app/components/ui/tooltip-v2.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types' -import React, {PureComponent} from 'react' -import {Tooltip as ReactTippy} from 'react-tippy' +import React, { PureComponent } from 'react' +import { Tooltip as ReactTippy } from 'react-tippy' export default class Tooltip extends PureComponent { static defaultProps = { @@ -39,7 +39,7 @@ export default class Tooltip extends PureComponent { } render () { - const {arrow, children, containerClassName, disabled, position, html, size, title, trigger, onHidden, wrapperClassName, style } = this.props + const { arrow, children, containerClassName, disabled, position, html, size, title, trigger, onHidden, wrapperClassName, style } = this.props if (!title && !html) { return ( diff --git a/ui/app/ducks/app/app.js b/ui/app/ducks/app/app.js index b877cefb4..7049ad904 100644 --- a/ui/app/ducks/app/app.js +++ b/ui/app/ducks/app/app.js @@ -150,7 +150,7 @@ export default function reduceApp (state, action) { state.appState.modal, { open: false }, { modalState: { name: null, props: {} } }, - { previousModalState: appState.modal.modalState}, + { previousModalState: appState.modal.modalState }, ), }) @@ -536,7 +536,7 @@ export default function reduceApp (state, action) { case actions.SET_HARDWARE_WALLET_DEFAULT_HD_PATH: const { device, path } = action.value - const newDefaults = {...appState.defaultHdPaths} + const newDefaults = { ...appState.defaultHdPaths } newDefaults[device] = path return extend(appState, { diff --git a/ui/app/ducks/gas/gas-duck.test.js b/ui/app/ducks/gas/gas-duck.test.js index 85450489d..0ae68628e 100644 --- a/ui/app/ducks/gas/gas-duck.test.js +++ b/ui/app/ducks/gas/gas-duck.test.js @@ -161,7 +161,7 @@ describe('Gas Duck', () => { GasReducer(mockState, { type: BASIC_GAS_ESTIMATE_LOADING_STARTED, }), - Object.assign({basicEstimateIsLoading: true}, mockState.gas) + Object.assign({ basicEstimateIsLoading: true }, mockState.gas) ) }) @@ -170,7 +170,7 @@ describe('Gas Duck', () => { GasReducer(mockState, { type: BASIC_GAS_ESTIMATE_LOADING_FINISHED, }), - Object.assign({basicEstimateIsLoading: false}, mockState.gas) + Object.assign({ basicEstimateIsLoading: false }, mockState.gas) ) }) @@ -179,7 +179,7 @@ describe('Gas Duck', () => { GasReducer(mockState, { type: GAS_ESTIMATE_LOADING_STARTED, }), - Object.assign({gasEstimatesLoading: true}, mockState.gas) + Object.assign({ gasEstimatesLoading: true }, mockState.gas) ) }) @@ -188,7 +188,7 @@ describe('Gas Duck', () => { GasReducer(mockState, { type: GAS_ESTIMATE_LOADING_FINISHED, }), - Object.assign({gasEstimatesLoading: false}, mockState.gas) + Object.assign({ gasEstimatesLoading: false }, mockState.gas) ) }) @@ -203,7 +203,7 @@ describe('Gas Duck', () => { type: SET_BASIC_GAS_ESTIMATE_DATA, value: { someProp: 'someData123' }, }), - Object.assign({basicEstimates: {someProp: 'someData123'} }, mockState.gas) + Object.assign({ basicEstimates: { someProp: 'someData123' } }, mockState.gas) ) }) @@ -213,7 +213,7 @@ describe('Gas Duck', () => { type: SET_PRICE_AND_TIME_ESTIMATES, value: { someProp: 'someData123' }, }), - Object.assign({priceAndTimeEstimates: {someProp: 'someData123'} }, mockState.gas) + Object.assign({ priceAndTimeEstimates: { someProp: 'someData123' } }, mockState.gas) ) }) @@ -223,7 +223,7 @@ describe('Gas Duck', () => { type: SET_CUSTOM_GAS_PRICE, value: 4321, }), - Object.assign({customData: {price: 4321} }, mockState.gas) + Object.assign({ customData: { price: 4321 } }, mockState.gas) ) }) @@ -233,7 +233,7 @@ describe('Gas Duck', () => { type: SET_CUSTOM_GAS_LIMIT, value: 9876, }), - Object.assign({customData: {limit: 9876} }, mockState.gas) + Object.assign({ customData: { limit: 9876 } }, mockState.gas) ) }) @@ -243,7 +243,7 @@ describe('Gas Duck', () => { type: SET_CUSTOM_GAS_TOTAL, value: 10000, }), - Object.assign({customData: {total: 10000} }, mockState.gas) + Object.assign({ customData: { total: 10000 } }, mockState.gas) ) }) @@ -273,7 +273,7 @@ describe('Gas Duck', () => { type: SET_CUSTOM_GAS_ERRORS, value: { someError: 'error_error' }, }), - Object.assign({errors: {someError: 'error_error'} }, mockState.gas) + Object.assign({ errors: { someError: 'error_error' } }, mockState.gas) ) }) @@ -316,7 +316,7 @@ describe('Gas Duck', () => { ) })) assert.deepEqual( mockDistpatch.getCall(0).args, - [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED} ] + [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED } ] ) assert.deepEqual( global.fetch.getCall(0).args, @@ -379,7 +379,7 @@ describe('Gas Duck', () => { ) })) assert.deepEqual( mockDistpatch.getCall(0).args, - [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED} ] + [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED } ] ) assert.ok(global.fetch.notCalled) assert.deepEqual( @@ -415,7 +415,7 @@ describe('Gas Duck', () => { ) })) assert.deepEqual( mockDistpatch.getCall(0).args, - [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED} ] + [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED } ] ) assert.deepEqual( global.fetch.getCall(0).args, @@ -469,7 +469,7 @@ describe('Gas Duck', () => { })) assert.deepEqual( mockDistpatch.getCall(0).args, - [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED} ] + [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED } ] ) assert.deepEqual( global.fetch.getCall(0).args, @@ -546,7 +546,7 @@ describe('Gas Duck', () => { })) assert.deepEqual( mockDistpatch.getCall(0).args, - [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED} ] + [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED } ] ) assert.ok(global.fetch.notCalled) @@ -590,7 +590,7 @@ describe('Gas Duck', () => { })) assert.deepEqual( mockDistpatch.getCall(0).args, - [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED} ] + [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED } ] ) assert.deepEqual( global.fetch.getCall(0).args, @@ -651,7 +651,7 @@ describe('Gas Duck', () => { })) assert.deepEqual( mockDistpatch.getCall(0).args, - [{ type: GAS_ESTIMATE_LOADING_STARTED} ] + [{ type: GAS_ESTIMATE_LOADING_STARTED } ] ) assert.deepEqual( global.fetch.getCall(0).args, @@ -705,7 +705,7 @@ describe('Gas Duck', () => { })) assert.deepEqual( mockDistpatch.getCall(0).args, - [{ type: GAS_ESTIMATE_LOADING_STARTED} ] + [{ type: GAS_ESTIMATE_LOADING_STARTED } ] ) assert.equal(global.fetch.callCount, 0) diff --git a/ui/app/ducks/gas/gas.duck.js b/ui/app/ducks/gas/gas.duck.js index 700fec6b0..e5c53c570 100644 --- a/ui/app/ducks/gas/gas.duck.js +++ b/ui/app/ducks/gas/gas.duck.js @@ -386,7 +386,7 @@ export function fetchGasEstimates (blockTime) { 'referrerPolicy': 'no-referrer-when-downgrade', 'body': null, 'method': 'GET', - 'mode': 'cors'} + 'mode': 'cors' } ) .then(r => r.json()) .then(r => { diff --git a/ui/app/ducks/send/send-duck.test.js b/ui/app/ducks/send/send-duck.test.js index 8248ba032..418707518 100644 --- a/ui/app/ducks/send/send-duck.test.js +++ b/ui/app/ducks/send/send-duck.test.js @@ -52,7 +52,7 @@ describe('Send Duck', () => { SendReducer(mockState, { type: OPEN_FROM_DROPDOWN, }), - Object.assign({fromDropdownOpen: true}, mockState.send) + Object.assign({ fromDropdownOpen: true }, mockState.send) ) }) @@ -66,7 +66,7 @@ describe('Send Duck', () => { SendReducer(mockState, { type: CLOSE_FROM_DROPDOWN, }), - Object.assign({fromDropdownOpen: false}, mockState.send) + Object.assign({ fromDropdownOpen: false }, mockState.send) ) }) @@ -75,7 +75,7 @@ describe('Send Duck', () => { SendReducer(mockState, { type: OPEN_TO_DROPDOWN, }), - Object.assign({toDropdownOpen: true}, mockState.send) + Object.assign({ toDropdownOpen: true }, mockState.send) ) }) @@ -84,7 +84,7 @@ describe('Send Duck', () => { SendReducer(mockState, { type: CLOSE_TO_DROPDOWN, }), - Object.assign({toDropdownOpen: false}, mockState.send) + Object.assign({ toDropdownOpen: false }, mockState.send) ) }) @@ -93,7 +93,7 @@ describe('Send Duck', () => { SendReducer(Object.assign({}, mockState, { gasButtonGroupShown: false }), { type: SHOW_GAS_BUTTON_GROUP, }), - Object.assign({gasButtonGroupShown: true}, mockState.send) + Object.assign({ gasButtonGroupShown: true }, mockState.send) ) }) @@ -102,7 +102,7 @@ describe('Send Duck', () => { SendReducer(mockState, { type: HIDE_GAS_BUTTON_GROUP, }), - Object.assign({gasButtonGroupShown: false}, mockState.send) + Object.assign({ gasButtonGroupShown: false }, mockState.send) ) }) diff --git a/ui/app/helpers/utils/conversion-util.test.js b/ui/app/helpers/utils/conversion-util.test.js index 368ce3bba..4420f9b4d 100644 --- a/ui/app/helpers/utils/conversion-util.test.js +++ b/ui/app/helpers/utils/conversion-util.test.js @@ -1,5 +1,5 @@ import assert from 'assert' -import {addCurrencies} from './conversion-util' +import { addCurrencies } from './conversion-util' describe('conversion utils', () => { diff --git a/ui/app/helpers/utils/util.js b/ui/app/helpers/utils/util.js index 75ba15410..3f412b2e3 100644 --- a/ui/app/helpers/utils/util.js +++ b/ui/app/helpers/utils/util.js @@ -304,7 +304,7 @@ function getContractAtAddress (tokenAddress) { function exportAsFile (filename, data, type = 'text/csv') { // source: https://stackoverflow.com/a/33542499 by Ludovic Feltz - const blob = new Blob([data], {type}) + const blob = new Blob([data], { type }) if (window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename) } else { 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 cc73b2ea7..90bfe1449 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 @@ -18,7 +18,7 @@ const mapStateToProps = ({ metamask }) => { const mapDispatchToProps = dispatch => { return { - addToken: ({address, symbol, decimals, image}) => dispatch(addToken(address, symbol, Number(decimals), image)), + addToken: ({ address, symbol, decimals, image }) => dispatch(addToken(address, symbol, Number(decimals), image)), removeSuggestedTokens: () => dispatch(removeSuggestedTokens()), } } diff --git a/ui/app/pages/confirm-transaction/conf-tx.js b/ui/app/pages/confirm-transaction/conf-tx.js index 91ff4b9e4..6ace92259 100644 --- a/ui/app/pages/confirm-transaction/conf-tx.js +++ b/ui/app/pages/confirm-transaction/conf-tx.js @@ -1,4 +1,4 @@ -import React, {Component} from 'react' +import React, { Component } from 'react' const inherits = require('util').inherits const connect = require('react-redux').connect const { withRouter } = require('react-router-dom') diff --git a/ui/app/pages/create-account/connect-hardware/connect-screen.js b/ui/app/pages/create-account/connect-hardware/connect-screen.js index 6be85f5b7..7c3c0f39b 100644 --- a/ui/app/pages/create-account/connect-hardware/connect-screen.js +++ b/ui/app/pages/create-account/connect-hardware/connect-screen.js @@ -30,7 +30,7 @@ class ConnectScreen extends Component { className={classnames('hw-connect__btn', { 'selected': this.state.selectedDevice === 'trezor', })} - onClick={_ => this.setState({selectedDevice: 'trezor'})} + onClick={_ => this.setState({ selectedDevice: 'trezor' })} > this.setState({selectedDevice: 'ledger'})} + onClick={_ => this.setState({ selectedDevice: 'ledger' })} > ) } @@ -136,7 +136,7 @@ class ConnectScreen extends Component { scrollToTutorial = () => { if (this.referenceNode) { - this.referenceNode.scrollIntoView({behavior: 'smooth'}) + this.referenceNode.scrollIntoView({ behavior: 'smooth' }) } } @@ -153,19 +153,19 @@ class ConnectScreen extends Component { const steps = [ { asset: 'hardware-wallet-step-1', - dimensions: {width: '225px', height: '75px'}, + dimensions: { width: '225px', height: '75px' }, title: this.context.t('step1HardwareWallet'), message: this.context.t('step1HardwareWalletMsg'), }, { asset: 'hardware-wallet-step-2', - dimensions: {width: '300px', height: '100px'}, + dimensions: { width: '300px', height: '100px' }, title: this.context.t('step2HardwareWallet'), message: this.context.t('step2HardwareWalletMsg'), }, { asset: 'hardware-wallet-step-3', - dimensions: {width: '120px', height: '90px'}, + dimensions: { width: '120px', height: '90px' }, title: this.context.t('step3HardwareWallet'), message: this.context.t('step3HardwareWalletMsg'), }, diff --git a/ui/app/pages/create-account/connect-hardware/index.js b/ui/app/pages/create-account/connect-hardware/index.js index 351699e8a..a1e1b62ce 100644 --- a/ui/app/pages/create-account/connect-hardware/index.js +++ b/ui/app/pages/create-account/connect-hardware/index.js @@ -29,7 +29,7 @@ class ConnectHardwareForm extends Component { a.balance = balanceValue ? formatBalance(balanceValue, 6) : '...' return a }) - this.setState({accounts: newAccounts}) + this.setState({ accounts: newAccounts }) } @@ -41,7 +41,7 @@ class ConnectHardwareForm extends Component { ['trezor', 'ledger'].forEach(async device => { const unlocked = await this.props.checkHardwareStatus(device, this.props.defaultHdPaths[device]) if (unlocked) { - this.setState({unlocked: true}) + this.setState({ unlocked: true }) this.getPage(device, 0, this.props.defaultHdPaths[device]) } }) @@ -57,16 +57,16 @@ class ConnectHardwareForm extends Component { } onPathChange = (path) => { - this.props.setHardwareWalletDefaultHdPath({device: this.state.device, path}) + this.props.setHardwareWalletDefaultHdPath({ device: this.state.device, path }) this.getPage(this.state.device, 0, path) } onAccountChange = (account) => { - this.setState({selectedAccount: account.toString(), error: null}) + this.setState({ selectedAccount: account.toString(), error: null }) } onAccountRestriction = () => { - this.setState({error: this.context.t('ledgerAccountRestriction') }) + this.setState({ error: this.context.t('ledgerAccountRestriction') }) } showTemporaryAlert () { @@ -117,7 +117,7 @@ class ConnectHardwareForm extends Component { .catch(e => { const errorMessage = e.message if (errorMessage === 'Window blocked') { - this.setState({ browserSupported: false, error: null}) + this.setState({ browserSupported: false, error: null }) } else if (errorMessage !== 'Window closed' && errorMessage !== 'Popup closed') { this.setState({ error: errorMessage }) } @@ -266,8 +266,8 @@ const mapStateToProps = state => { const mapDispatchToProps = dispatch => { return { - setHardwareWalletDefaultHdPath: ({device, path}) => { - return dispatch(actions.setHardwareWalletDefaultHdPath({device, path})) + setHardwareWalletDefaultHdPath: ({ device, path }) => { + return dispatch(actions.setHardwareWalletDefaultHdPath({ device, path })) }, connectHardware: (deviceName, page, hdPath) => { return dispatch(actions.connectHardware(deviceName, page, hdPath)) diff --git a/ui/app/pages/create-account/create-account.component.js b/ui/app/pages/create-account/create-account.component.js index 1f8bc0cc5..90c9105b7 100644 --- a/ui/app/pages/create-account/create-account.component.js +++ b/ui/app/pages/create-account/create-account.component.js @@ -13,7 +13,7 @@ import { export default class CreateAccountPage extends Component { renderTabs () { - const { history, location: { pathname }} = this.props + const { history, location: { pathname } } = this.props const getClassNames = path => classnames('new-account__tabs__tab', { 'new-account__tabs__selected': matchPath(pathname, { path, diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js index 53d4614ad..c93588875 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js @@ -1,4 +1,4 @@ -import {validateMnemonic} from 'bip39' +import { validateMnemonic } from 'bip39' import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import TextField from '../../../../components/ui/text-field' @@ -175,7 +175,7 @@ export default class ImportWithSeedPhrase extends PureComponent { return !passwordError && !confirmPasswordError && !seedPhraseError } - onTermsKeyPress = ({key}) => { + onTermsKeyPress = ({ key }) => { if (key === ' ' || key === 'Enter') { this.toggleTermsCheck() } 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 7960d17b2..f6a2ad8ca 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 @@ -29,7 +29,7 @@ describe('ImportWithSeedPhrase Component', () => { onSubmit: sinon.spy(), }) - const {parseSeedPhrase} = root.instance() + const { parseSeedPhrase } = root.instance() assert.deepEqual(parseSeedPhrase('foo bar baz'), 'foo bar baz') }) @@ -39,7 +39,7 @@ describe('ImportWithSeedPhrase Component', () => { onSubmit: sinon.spy(), }) - const {parseSeedPhrase} = root.instance() + const { parseSeedPhrase } = root.instance() assert.deepEqual(parseSeedPhrase(' foo bar baz '), 'foo bar baz') }) @@ -49,7 +49,7 @@ describe('ImportWithSeedPhrase Component', () => { onSubmit: sinon.spy(), }) - const {parseSeedPhrase} = root.instance() + const { parseSeedPhrase } = root.instance() assert.deepEqual(parseSeedPhrase(' '), '') }) @@ -59,7 +59,7 @@ describe('ImportWithSeedPhrase Component', () => { onSubmit: sinon.spy(), }) - const {parseSeedPhrase} = root.instance() + const { parseSeedPhrase } = root.instance() assert.deepEqual(parseSeedPhrase('$'), '') }) @@ -69,7 +69,7 @@ describe('ImportWithSeedPhrase Component', () => { onSubmit: sinon.spy(), }) - const {parseSeedPhrase} = root.instance() + const { parseSeedPhrase } = root.instance() assert.deepEqual(parseSeedPhrase(undefined), '') assert.deepEqual(parseSeedPhrase(null), '') diff --git a/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js b/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js index a8445474b..2da9d62e0 100644 --- a/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js +++ b/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js @@ -128,7 +128,7 @@ export default class NewAccount extends PureComponent { })) } - onTermsKeyPress = ({key}) => { + onTermsKeyPress = ({ key }) => { if (key === ' ' || key === 'Enter') { this.toggleTermsCheck() } 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 ae38757d9..329b472a9 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 @@ -10,7 +10,7 @@ import { DEFAULT_ROUTE, } from '../../../helpers/constants/routes' import HTML5Backend from 'react-dnd-html5-backend' -import {DragDropContextProvider} from 'react-dnd' +import { DragDropContextProvider } from 'react-dnd' import MetaFoxLogo from '../../../components/ui/metafox-logo' export default class SeedPhrase extends PureComponent { diff --git a/ui/app/pages/keychains/restore-vault.js b/ui/app/pages/keychains/restore-vault.js index 93c2975bb..8f7f399b0 100644 --- a/ui/app/pages/keychains/restore-vault.js +++ b/ui/app/pages/keychains/restore-vault.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' +import { connect } from 'react-redux' import { createNewVaultAndRestore, unMarkPasswordForgotten, diff --git a/ui/app/pages/mobile-sync/mobile-sync.component.js b/ui/app/pages/mobile-sync/mobile-sync.component.js index 9510afa80..85aad062a 100644 --- a/ui/app/pages/mobile-sync/mobile-sync.component.js +++ b/ui/app/pages/mobile-sync/mobile-sync.component.js @@ -72,7 +72,7 @@ export default class MobileSyncPage extends Component { generateCipherKeyAndChannelName () { this.cipherKey = `${this.props.selectedAddress.substr(-4)}-${PubNub.generateUUID()}` this.channelName = `mm-${PubNub.generateUUID()}` - this.setState({cipherKey: this.cipherKey, channelName: this.channelName}) + this.setState({ cipherKey: this.cipherKey, channelName: this.channelName }) } initWithCipherKeyAndChannelName (cipherKey, channelName) { @@ -93,7 +93,7 @@ export default class MobileSyncPage extends Component { this.pubnubListener = { message: (data) => { - const {channel, message} = data + const { channel, message } = data // handle message if (channel !== this.channelName || !message) { return false @@ -108,7 +108,7 @@ export default class MobileSyncPage extends Component { this.initWebsockets() } else if (message.event === 'end-sync') { this.disconnectWebsockets() - this.setState({syncing: false, completed: true}) + this.setState({ syncing: false, completed: true }) } }, } @@ -171,7 +171,7 @@ export default class MobileSyncPage extends Component { return false } this.syncing = true - this.setState({syncing: true}) + this.setState({ syncing: true }) const { accounts, network, preferences, transactions } = await this.props.fetchInfoToSync() @@ -194,7 +194,7 @@ export default class MobileSyncPage extends Component { } } catch (e) { this.props.displayWarning('Sync failed :(') - this.setState({syncing: false}) + this.setState({ syncing: false }) this.syncing = false this.notifyError(e.toString()) } diff --git a/ui/app/pages/routes/index.js b/ui/app/pages/routes/index.js index b2a2ced68..fe27dfb5b 100644 --- a/ui/app/pages/routes/index.js +++ b/ui/app/pages/routes/index.js @@ -240,7 +240,7 @@ class Routes extends Component { return (
setMouseUserState(true)} onKeyDown={e => { diff --git a/ui/app/pages/send/send-content/add-recipient/add-recipient.component.js b/ui/app/pages/send/send-content/add-recipient/add-recipient.component.js index a2e6b49db..40382cdd5 100644 --- a/ui/app/pages/send/send-content/add-recipient/add-recipient.component.js +++ b/ui/app/pages/send/send-content/add-recipient/add-recipient.component.js @@ -2,11 +2,11 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import Fuse from 'fuse.js' import Identicon from '../../../../components/ui/identicon' -import {isValidAddress} from '../../../../helpers/utils/util' +import { isValidAddress } from '../../../../helpers/utils/util' import Dialog from '../../../../components/ui/dialog' import ContactList from '../../../../components/app/contact-list' import RecipientGroup from '../../../../components/app/contact-list/recipient-group/recipient-group.component' -import {ellipsify} from '../../send.utils' +import { ellipsify } from '../../send.utils' export default class AddRecipient extends Component { 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 a4b5c8810..4f342d857 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 @@ -2,7 +2,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import c from 'classnames' import { isValidENSAddress, isValidAddress, isValidAddressHead } from '../../../../helpers/utils/util' -import {ellipsify} from '../../send.utils' +import { ellipsify } from '../../send.utils' import debounce from 'debounce' import copyToClipboard from 'copy-to-clipboard/index' diff --git a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js index 182504c5d..5549c2503 100644 --- a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js +++ b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js @@ -56,24 +56,24 @@ describe('add-recipient utils', () => { }) it('should return null if to is truthy but part of state tokens', () => { - assert.deepEqual(getToErrorObject('0xabc123', undefined, false, [{'address': '0xabc123'}], {'address': '0xabc123'}), { + assert.deepEqual(getToErrorObject('0xabc123', undefined, false, [{ 'address': '0xabc123' }], { 'address': '0xabc123' }), { to: null, }) }) it('should null if to is truthy part of tokens but selectedToken falsy', () => { - assert.deepEqual(getToErrorObject('0xabc123', undefined, false, [{'address': '0xabc123'}]), { + assert.deepEqual(getToErrorObject('0xabc123', undefined, false, [{ 'address': '0xabc123' }]), { to: null, }) }) it('should return null if to is truthy but part of contract metadata', () => { - assert.deepEqual(getToErrorObject('0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', undefined, false, [{'address': '0xabc123'}], {'address': '0xabc123'}), { + assert.deepEqual(getToErrorObject('0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', undefined, false, [{ 'address': '0xabc123' }], { 'address': '0xabc123' }), { to: null, }) }) it('should null if to is truthy part of contract metadata but selectedToken falsy', () => { - assert.deepEqual(getToErrorObject('0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', undefined, false, [{'address': '0xabc123'}], {'address': '0xabc123'}), { + assert.deepEqual(getToErrorObject('0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', undefined, false, [{ 'address': '0xabc123' }], { 'address': '0xabc123' }), { to: null, }) }) @@ -81,24 +81,24 @@ describe('add-recipient utils', () => { describe('getToWarningObject()', () => { it('should return a known address recipient if to is truthy but part of state tokens', () => { - assert.deepEqual(getToWarningObject('0xabc123', undefined, [{'address': '0xabc123'}], {'address': '0xabc123'}), { + assert.deepEqual(getToWarningObject('0xabc123', undefined, [{ 'address': '0xabc123' }], { 'address': '0xabc123' }), { to: KNOWN_RECIPIENT_ADDRESS_ERROR, }) }) it('should null if to is truthy part of tokens but selectedToken falsy', () => { - assert.deepEqual(getToWarningObject('0xabc123', undefined, [{'address': '0xabc123'}]), { + assert.deepEqual(getToWarningObject('0xabc123', undefined, [{ 'address': '0xabc123' }]), { to: null, }) }) it('should return a known address recipient if to is truthy but part of contract metadata', () => { - assert.deepEqual(getToWarningObject('0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', undefined, [{'address': '0xabc123'}], {'address': '0xabc123'}), { + assert.deepEqual(getToWarningObject('0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', undefined, [{ 'address': '0xabc123' }], { 'address': '0xabc123' }), { to: KNOWN_RECIPIENT_ADDRESS_ERROR, }) }) it('should null if to is truthy part of contract metadata but selectedToken falsy', () => { - assert.deepEqual(getToWarningObject('0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', undefined, [{'address': '0xabc123'}], {'address': '0xabc123'}), { + assert.deepEqual(getToWarningObject('0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', undefined, [{ 'address': '0xabc123' }], { 'address': '0xabc123' }), { to: KNOWN_RECIPIENT_ADDRESS_ERROR, }) }) diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js index dcee8fda0..0307388d7 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js @@ -29,7 +29,7 @@ proxyquire('../amount-max-button.container.js', { }, './amount-max-button.selectors.js': { getMaxModeOn: (s) => `mockMaxModeOn:${s}` }, './amount-max-button.utils.js': { calcMaxAmount: (mockObj) => mockObj.val + 1 }, - '../../../../../selectors/custom-gas': { getBasicGasEstimateLoadingStatus: (s) => `mockButtonDataLoading:${s}`}, + '../../../../../selectors/custom-gas': { getBasicGasEstimateLoadingStatus: (s) => `mockButtonDataLoading:${s}` }, '../../../../../store/actions': actionSpies, '../../../../../ducks/send/send.duck': duckActionSpies, }) diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js index c0b604505..d0a44d0ae 100644 --- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js @@ -4,7 +4,7 @@ import SendRowWrapper from '../send-row-wrapper' import Identicon from '../../../../components/ui/identicon/identicon.component' import TokenBalance from '../../../../components/ui/token-balance' import UserPreferencedCurrencyDisplay from '../../../../components/app/user-preferenced-currency-display' -import {PRIMARY} from '../../../../helpers/constants/common' +import { PRIMARY } from '../../../../helpers/constants/common' export default class SendAssetRow extends Component { static propTypes = { 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 57b62fba1..1722e2a47 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,6 +1,6 @@ import { connect } from 'react-redux' import SendAssetRow from './send-asset-row.component' -import {getMetaMaskAccounts} from '../../../../selectors/selectors' +import { getMetaMaskAccounts } from '../../../../selectors/selectors' import { setSelectedToken } from '../../../../store/actions' function mapStateToProps (state) { diff --git a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js index 473dbb0b1..b69ddba0f 100644 --- a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js +++ b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js @@ -1,4 +1,4 @@ -import React, {Component} from 'react' +import React, { Component } from 'react' import PropTypes from 'prop-types' import UserPreferencedCurrencyDisplay from '../../../../../components/app/user-preferenced-currency-display' import { PRIMARY, SECONDARY } from '../../../../../helpers/constants/common' diff --git a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js index 1dd34a25a..3ff2ddec2 100644 --- a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js +++ b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js @@ -1,6 +1,6 @@ import React from 'react' import assert from 'assert' -import {shallow} from 'enzyme' +import { shallow } from 'enzyme' import GasFeeDisplay from '../gas-fee-display.component' import UserPreferencedCurrencyDisplay from '../../../../../../components/app/user-preferenced-currency-display' import sinon from 'sinon' @@ -24,7 +24,7 @@ describe('GasFeeDisplay Component', function () { showGasButtonGroup={propsMethodSpies.showCustomizeGasModal} onReset={propsMethodSpies.onReset} /> - ), {context: {t: str => str + '_t'}}) + ), { context: { t: str => str + '_t' } }) }) afterEach(() => { diff --git a/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js index 152c59db9..ce9bd3a22 100644 --- a/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js +++ b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js @@ -15,15 +15,15 @@ export default class SendHexDataRow extends Component { }; onInput = (event) => { - const {updateSendHexData, updateGas} = this.props + const { updateSendHexData, updateGas } = this.props const data = event.target.value.replace(/\n/g, '') || null updateSendHexData(data) updateGas({ data }) } render () { - const {inError} = this.props - const {t} = this.context + const { inError } = this.props + const { t } = this.context return ( {this.context.t(errorMessage)}
+ ?
{this.context.t(errorMessage)}
: null ) } 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 5f575a60e..c992d97e2 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 @@ -43,7 +43,7 @@ describe('SendContent Component', function () { }) it('should render a SendRowErrorMessage with and errorType props if showError is true', () => { - wrapper.setProps({showError: true}) + wrapper.setProps({ showError: true }) assert.equal(wrapper.find(SendRowErrorMessage).length, 1) const expectedSendRowErrorMessage = wrapper.find('.send-v2__form-row > .send-v2__form-label').childAt(1) diff --git a/ui/app/pages/send/send-footer/send-footer.component.js b/ui/app/pages/send/send-footer/send-footer.component.js index f637fb8c7..73a3d3256 100644 --- a/ui/app/pages/send/send-footer/send-footer.component.js +++ b/ui/app/pages/send/send-footer/send-footer.component.js @@ -47,7 +47,7 @@ export default class SendFooter extends Component { amount, data, editingTransactionId, - from: {address: from}, + from: { address: from }, gasLimit: gas, gasPrice, selectedToken, diff --git a/ui/app/pages/send/send-footer/tests/send-footer-selectors.test.js b/ui/app/pages/send/send-footer/tests/send-footer-selectors.test.js index 8de032f57..36f3a809f 100644 --- a/ui/app/pages/send/send-footer/tests/send-footer-selectors.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-selectors.test.js @@ -13,11 +13,11 @@ describe('send-footer selectors', () => { describe('getTitleKey()', () => { it('should return true if any of the values of the object returned by getSendErrors are truthy', () => { - assert.equal(isSendFormInError({ errors: { a: 'abc', b: false} }), true) + assert.equal(isSendFormInError({ errors: { a: 'abc', b: false } }), true) }) it('should return false if all of the values of the object returned by getSendErrors are falsy', () => { - assert.equal(isSendFormInError({ errors: { a: false, b: null} }), false) + assert.equal(isSendFormInError({ errors: { a: false, b: null } }), false) }) }) diff --git a/ui/app/pages/send/send.container.js b/ui/app/pages/send/send.container.js index 2350712f3..cb3261403 100644 --- a/ui/app/pages/send/send.container.js +++ b/ui/app/pages/send/send.container.js @@ -127,7 +127,7 @@ function mapDispatchToProps (dispatch) { updateSendEnsResolutionError: (message) => dispatch(updateSendEnsResolutionError(message)), updateToNicknameIfNecessary: (to, toNickname, addressBook) => { if (isValidENSAddress(toNickname)) { - const addressBookEntry = addressBook.find(({ address}) => to === address) || {} + const addressBookEntry = addressBook.find(({ address }) => to === address) || {} if (!addressBookEntry.name !== toNickname) { dispatch(updateSendTo(to, addressBookEntry.name || '')) } diff --git a/ui/app/pages/send/tests/send-component.test.js b/ui/app/pages/send/tests/send-component.test.js index bac01cf25..6e6fbe1a5 100644 --- a/ui/app/pages/send/tests/send-component.test.js +++ b/ui/app/pages/send/tests/send-component.test.js @@ -53,7 +53,7 @@ describe('Send Component', function () { gasLimit="mockGasLimit" gasPrice="mockGasPrice" gasTotal="mockGasTotal" - history={{ mockProp: 'history-abc'}} + history={{ mockProp: 'history-abc' }} network="3" primaryCurrency="mockPrimaryCurrency" recentBlocks={['mockBlock']} @@ -228,7 +228,7 @@ describe('Send Component', function () { it('should call updateSendErrors with the expected params if selectedToken is truthy', () => { propsMethodSpies.updateSendErrors.resetHistory() - wrapper.setProps({ selectedToken: { address: 'mockTokenAddress', decimals: 18, symbol: 'TST' }}) + wrapper.setProps({ selectedToken: { address: 'mockTokenAddress', decimals: 18, symbol: 'TST' } }) wrapper.instance().componentDidUpdate({ from: { balance: 'balanceChanged', diff --git a/ui/app/pages/send/tests/send-container.test.js b/ui/app/pages/send/tests/send-container.test.js index f4142bc2d..5afec0148 100644 --- a/ui/app/pages/send/tests/send-container.test.js +++ b/ui/app/pages/send/tests/send-container.test.js @@ -135,7 +135,7 @@ describe('send container', () => { it('should dispatch an updateGasData action when editingTransactionId is falsy', () => { const { gasPrice, selectedAddress, selectedToken, recentBlocks, blockGasLimit, to, value, data } = mockProps mapDispatchToPropsObject.updateAndSetGasLimit( - Object.assign({}, mockProps, {editingTransactionId: false}) + Object.assign({}, mockProps, { editingTransactionId: false }) ) assert(dispatchSpy.calledOnce) assert.deepEqual( @@ -149,7 +149,7 @@ describe('send container', () => { const mockProps = { address: '0x10', tokenContract: '0x00a', - selectedToken: {address: '0x1'}, + selectedToken: { address: '0x1' }, } it('should dispatch an action', () => { diff --git a/ui/app/pages/send/tests/send-selectors-test-data.js b/ui/app/pages/send/tests/send-selectors-test-data.js index de078c03e..91b96dd98 100644 --- a/ui/app/pages/send/tests/send-selectors-test-data.js +++ b/ui/app/pages/send/tests/send-selectors-test-data.js @@ -2,7 +2,7 @@ module.exports = { 'metamask': { 'isInitialized': true, 'isUnlocked': true, - 'featureFlags': {'sendHexData': true}, + 'featureFlags': { 'sendHexData': true }, 'rpcTarget': 'https://rawtestrpc.metamask.io/', 'identities': { '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': { diff --git a/ui/app/pages/send/tests/send-utils.test.js b/ui/app/pages/send/tests/send-utils.test.js index 9f6a01ad5..f6556de06 100644 --- a/ui/app/pages/send/tests/send-utils.test.js +++ b/ui/app/pages/send/tests/send-utils.test.js @@ -122,12 +122,12 @@ describe('send utils', () => { describe('generateTokenTransferData()', () => { it('should return undefined if not passed a selected token', () => { - assert.equal(generateTokenTransferData({ toAddress: 'mockAddress', amount: '0xa', selectedToken: false}), undefined) + assert.equal(generateTokenTransferData({ toAddress: 'mockAddress', amount: '0xa', selectedToken: false }), undefined) }) it('should call abi.rawEncode with the correct params', () => { stubs.rawEncode.resetHistory() - generateTokenTransferData({ toAddress: 'mockAddress', amount: 'ab', selectedToken: true}) + generateTokenTransferData({ toAddress: 'mockAddress', amount: 'ab', selectedToken: true }) assert.deepEqual( stubs.rawEncode.getCall(0).args, [['address', 'uint256'], ['mockAddress', '0xab']] @@ -136,7 +136,7 @@ describe('send utils', () => { it('should return encoded token transfer data', () => { assert.equal( - generateTokenTransferData({ toAddress: 'mockAddress', amount: '0xa', selectedToken: true}), + generateTokenTransferData({ toAddress: 'mockAddress', amount: '0xa', selectedToken: true }), '0xa9059cbb104c' ) }) @@ -307,7 +307,7 @@ describe('send utils', () => { selectedAddress: 'mockAddress', to: '0xisContract', estimateGasMethod: sinon.stub().callsFake( - ({to}, cb) => { + ({ to }, cb) => { const err = typeof to === 'string' && to.match(/willFailBecauseOf:/) ? new Error(to.match(/:(.+)$/)[1]) : null @@ -374,11 +374,11 @@ describe('send utils', () => { it('should call ethQuery.estimateGas without a recipient if the recipient is empty and data passed', async () => { const data = 'mockData' const to = '' - const result = await estimateGas({...baseMockParams, data, to}) + const result = await estimateGas({ ...baseMockParams, data, to }) assert.equal(baseMockParams.estimateGasMethod.callCount, 1) assert.deepEqual( baseMockParams.estimateGasMethod.getCall(0).args[0], - { gasPrice: undefined, value: '0xff', data, from: baseExpectedCall.from, gas: baseExpectedCall.gas}, + { gasPrice: undefined, value: '0xff', data, from: baseExpectedCall.from, gas: baseExpectedCall.gas }, ) assert.equal(result, '0xabc16') }) 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 8b64e864f..876b1fd40 100644 --- a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js +++ b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js @@ -13,7 +13,7 @@ import { turnThreeBoxSyncingOnAndInitialize, setUseNonceField, } from '../../../store/actions' -import {preferencesSelector} from '../../../selectors/selectors' +import { preferencesSelector } from '../../../selectors/selectors' export const mapStateToProps = state => { const { appState: { warning }, metamask } = state diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js index bcd21d107..5903bbf27 100644 --- a/ui/app/selectors/selectors.js +++ b/ui/app/selectors/selectors.js @@ -179,7 +179,7 @@ export function getAddressBookEntryName (state, address) { export function getDaiV1Token (state) { const OLD_DAI_CONTRACT_ADDRESS = '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359' const tokens = state.metamask.tokens || [] - return tokens.find(({address}) => checksumAddress(address) === OLD_DAI_CONTRACT_ADDRESS) + return tokens.find(({ address }) => checksumAddress(address) === OLD_DAI_CONTRACT_ADDRESS) } export function accountsWithSendEtherInfoSelector (state) { diff --git a/ui/app/selectors/tests/selectors-test-data.js b/ui/app/selectors/tests/selectors-test-data.js index 12828dd05..4e0a06e3f 100644 --- a/ui/app/selectors/tests/selectors-test-data.js +++ b/ui/app/selectors/tests/selectors-test-data.js @@ -2,7 +2,7 @@ module.exports = { 'metamask': { 'isInitialized': true, 'isUnlocked': true, - 'featureFlags': {'sendHexData': true}, + 'featureFlags': { 'sendHexData': true }, 'rpcTarget': 'https://rawtestrpc.metamask.io/', 'identities': { '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': { diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index a09548f0f..93480bca8 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -731,7 +731,7 @@ function addNewAccount () { const oldIdentities = getState().metamask.identities dispatch(actions.showLoadingIndication()) return new Promise((resolve, reject) => { - background.addNewAccount((err, { identities: newIdentities}) => { + background.addNewAccount((err, { identities: newIdentities }) => { if (err) { dispatch(actions.displayWarning(err.message)) return reject(err) @@ -1378,7 +1378,7 @@ function cancelTx (txData) { function cancelTxs (txDataList) { return async (dispatch) => { dispatch(actions.showLoadingIndication()) - const txIds = txDataList.map(({id}) => id) + const txIds = txDataList.map(({ id }) => id) const cancellations = txIds.map((id) => new Promise((resolve, reject) => { background.cancelTransaction(id, (err) => { if (err) { @@ -1648,7 +1648,7 @@ function showAccountsPage () { } } -function showConfTxPage ({transForward = true, id}) { +function showConfTxPage ({ transForward = true, id }) { return { type: actions.SHOW_CONF_TX_PAGE, transForward, @@ -1774,7 +1774,7 @@ function removeSuggestedTokens () { }) }) .then(() => updateMetamaskStateFromBackground()) - .then(suggestedTokens => dispatch(actions.updateMetamaskState({...suggestedTokens}))) + .then(suggestedTokens => dispatch(actions.updateMetamaskState({ ...suggestedTokens }))) } } @@ -2138,7 +2138,7 @@ function showLoadingIndication (message) { function setHardwareWalletDefaultHdPath ({ device, path }) { return { type: actions.SET_HARDWARE_WALLET_DEFAULT_HD_PATH, - value: {device, path}, + value: { device, path }, } } @@ -2298,7 +2298,7 @@ function pairUpdate (coin) { return (dispatch) => { dispatch(actions.showSubLoadingIndication()) dispatch(actions.hideWarning()) - shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => { + shapeShiftRequest('marketinfo', { pair: `${coin.toLowerCase()}_eth` }, (mktResponse) => { dispatch(actions.hideSubLoadingIndication()) if (mktResponse.error) { return dispatch(actions.displayWarning(mktResponse.error)) @@ -2317,7 +2317,7 @@ function shapeShiftSubview () { const pair = 'btc_eth' return (dispatch) => { dispatch(actions.showSubLoadingIndication()) - shapeShiftRequest('marketinfo', {pair}, (mktResponse) => { + shapeShiftRequest('marketinfo', { pair }, (mktResponse) => { shapeShiftRequest('getcoins', {}, (response) => { dispatch(actions.hideSubLoadingIndication()) if (mktResponse.error) { @@ -2338,7 +2338,7 @@ function shapeShiftSubview () { function coinShiftRquest (data, marketData) { return (dispatch) => { dispatch(actions.showLoadingIndication()) - shapeShiftRequest('shift', { method: 'POST', data}, (response) => { + shapeShiftRequest('shift', { method: 'POST', data }, (response) => { dispatch(actions.hideLoadingIndication()) if (response.error) { return dispatch(actions.displayWarning(response.error)) @@ -2354,7 +2354,7 @@ function coinShiftRquest (data, marketData) { function buyWithShapeShift (data) { return () => new Promise((resolve, reject) => { - shapeShiftRequest('shift', { method: 'POST', data}, (response) => { + shapeShiftRequest('shift', { method: 'POST', data }, (response) => { if (response.error) { return reject(response.error) } @@ -2376,7 +2376,7 @@ function showQrView (data, message) { function reshowQrCode (data, coin) { return (dispatch) => { dispatch(actions.showLoadingIndication()) - shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => { + shapeShiftRequest('marketinfo', { pair: `${coin.toLowerCase()}_eth` }, (mktResponse) => { if (mktResponse.error) { return dispatch(actions.displayWarning(mktResponse.error)) } @@ -2406,7 +2406,7 @@ function shapeShiftRequest (query, options = {}, cb) { return queryResponse } catch (e) { if (cb) { - cb({error: e}) + cb({ error: e }) } return e } diff --git a/ui/index.js b/ui/index.js index 6f7a43963..028aa3d05 100644 --- a/ui/index.js +++ b/ui/index.js @@ -13,7 +13,7 @@ module.exports = launchMetamaskUi log.setLevel(global.METAMASK_DEBUG ? 'debug' : 'warn') function launchMetamaskUi (opts, cb) { - const {backgroundConnection} = opts + const { backgroundConnection } = opts actions._setBackgroundConnection(backgroundConnection) // check if we are unlocked first backgroundConnection.getState(function (err, metamaskState) { diff --git a/ui/lib/feature-toggle-utils.js b/ui/lib/feature-toggle-utils.js index 6d4e461ca..ed0844d2e 100644 --- a/ui/lib/feature-toggle-utils.js +++ b/ui/lib/feature-toggle-utils.js @@ -1,7 +1,7 @@ function checkFeatureToggle (name) { const queryPairMap = window.location.search.substr(1).split('&') .map(pair => pair.split('=')) - .reduce((pairs, [key, value]) => ({...pairs, [key]: value }), {}) + .reduce((pairs, [key, value]) => ({ ...pairs, [key]: value }), {}) const featureToggles = queryPairMap['ft'] ? queryPairMap['ft'].split(',') : [] return Boolean(featureToggles.find(ft => ft === name)) } diff --git a/ui/lib/webcam-utils.js b/ui/lib/webcam-utils.js index bd7a5a0e0..0a6fe27f7 100644 --- a/ui/lib/webcam-utils.js +++ b/ui/lib/webcam-utils.js @@ -23,11 +23,11 @@ class WebcamUtils { environmentReady, }) } else { - reject({type: 'NO_WEBCAM_FOUND'}) + reject({ type: 'NO_WEBCAM_FOUND' }) } }) } catch (e) { - reject({type: 'UNKNOWN_ERROR'}) + reject({ type: 'UNKNOWN_ERROR' }) } }) }