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(