Skip to content

Commit

Permalink
yarn lint --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
whymarrh committed Dec 3, 2019
1 parent 5ed921c commit 274a9ec
Show file tree
Hide file tree
Showing 127 changed files with 324 additions and 324 deletions.
2 changes: 1 addition & 1 deletion app/scripts/background.js
Expand Up @@ -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()
}
Expand Down
6 changes: 3 additions & 3 deletions app/scripts/controllers/app-state.js
Expand Up @@ -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({
Expand Down Expand Up @@ -62,7 +62,7 @@ class AppStateController {
* @private
*/
_resetTimer () {
const {timeoutMinutes} = this.store.getState()
const { timeoutMinutes } = this.store.getState()

if (this.timer) {
clearTimeout(this.timer)
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/detect-tokens.js
Expand Up @@ -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'
/**
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/controllers/network/middleware/pending.js
Expand Up @@ -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()
}
Expand All @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/permissions/methodMiddleware.js
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions app/scripts/controllers/preferences.js
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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 })
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/controllers/transactions/index.js
Expand Up @@ -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 } })
}
}

Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/lib/ens-ipfs/contracts/registry.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/scripts/lib/ens-ipfs/contracts/resolver.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/scripts/lib/ens-ipfs/resolver.js
Expand Up @@ -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
Expand All @@ -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()`)
}
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/lib/ens-ipfs/setup.js
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 274a9ec

Please sign in to comment.