From 6c1bce28acd50727f772325eb00dfd06a951a6f2 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 16 Dec 2019 19:54:52 -0330 Subject: [PATCH] Fix a few instances of signature mismatches (#7704) Co-Authored-By: Mark Stacey --- app/scripts/background.js | 4 ++-- app/scripts/contentscript.js | 2 +- app/scripts/controllers/preferences.js | 2 +- app/scripts/controllers/recent-blocks.js | 4 ++-- .../controllers/transactions/lib/tx-state-history-helper.js | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/scripts/background.js b/app/scripts/background.js index 7dd13e083..31fcb7d77 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -298,10 +298,10 @@ function setupController (initState, initLangCode) { async function persistData (state) { if (!state) { - throw new Error('MetaMask - updated state is missing', state) + throw new Error('MetaMask - updated state is missing') } if (!state.data) { - throw new Error('MetaMask - updated state does not have data', state) + throw new Error('MetaMask - updated state does not have data') } if (localStore.isSupported) { try { diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index d583399ae..7614d88d7 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -34,7 +34,7 @@ function injectScript (content) { try { const container = document.head || document.documentElement const scriptTag = document.createElement('script') - scriptTag.setAttribute('async', false) + scriptTag.setAttribute('async', 'false') scriptTag.textContent = content container.insertBefore(scriptTag, container.children[0]) container.removeChild(scriptTag) diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 780a41e80..7964a8250 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -671,7 +671,7 @@ class PreferencesController { /** * A getter for `tokens` and `accountTokens` related states. * - * @param {string} selectedAddress A new hex address for an account + * @param {string} [selectedAddress] A new hex address for an account * @returns {Object.} States to interact with tokens in `accountTokens` * */ diff --git a/app/scripts/controllers/recent-blocks.js b/app/scripts/controllers/recent-blocks.js index 05e1c3f0a..17a8ecdad 100644 --- a/app/scripts/controllers/recent-blocks.js +++ b/app/scripts/controllers/recent-blocks.js @@ -79,7 +79,7 @@ class RecentBlocksController { */ async processBlock (newBlockNumberHex) { const newBlockNumber = Number.parseInt(newBlockNumberHex, 16) - const newBlock = await this.getBlockByNumber(newBlockNumber, true) + const newBlock = await this.getBlockByNumber(newBlockNumber) if (!newBlock) { return } @@ -153,7 +153,7 @@ class RecentBlocksController { const targetBlockNumbers = Array(blocksToFetch).fill().map((_, index) => prevBlockNumber - index) await Promise.all(targetBlockNumbers.map(async (targetBlockNumber) => { try { - const newBlock = await this.getBlockByNumber(targetBlockNumber, true) + const newBlock = await this.getBlockByNumber(targetBlockNumber) if (!newBlock) { return } diff --git a/app/scripts/controllers/transactions/lib/tx-state-history-helper.js b/app/scripts/controllers/transactions/lib/tx-state-history-helper.js index 3cc76e617..512d75ad0 100644 --- a/app/scripts/controllers/transactions/lib/tx-state-history-helper.js +++ b/app/scripts/controllers/transactions/lib/tx-state-history-helper.js @@ -35,7 +35,7 @@ function migrateFromSnapshotsToDiffs (longHistory) { with the first entry having the note and a timestamp when the change took place @param previousState {object} - the previous state of the object @param newState {object} - the update object - @param note {string} - a optional note for the state change + @param {string} [note] - a optional note for the state change @returns {array} */ function generateHistoryEntry (previousState, newState, note) {