aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r--app/scripts/controllers/balance.js4
-rw-r--r--app/scripts/controllers/blacklist.js2
-rw-r--r--app/scripts/controllers/computed-balances.js2
-rw-r--r--app/scripts/controllers/currency.js8
-rw-r--r--app/scripts/controllers/network/network.js2
-rw-r--r--app/scripts/controllers/preferences.js6
-rw-r--r--app/scripts/controllers/recent-blocks.js2
-rw-r--r--app/scripts/controllers/transactions/lib/recipient-blacklist-checker.js2
-rw-r--r--app/scripts/controllers/transactions/lib/recipient-blacklist-config.json14
-rw-r--r--app/scripts/controllers/transactions/lib/recipient-blacklist.js17
-rw-r--r--app/scripts/controllers/transactions/tx-gas-utils.js2
11 files changed, 32 insertions, 29 deletions
diff --git a/app/scripts/controllers/balance.js b/app/scripts/controllers/balance.js
index 86619fce1..4c97810a3 100644
--- a/app/scripts/controllers/balance.js
+++ b/app/scripts/controllers/balance.js
@@ -60,7 +60,7 @@ class BalanceController {
* Sets up listeners and subscriptions which should trigger an update of ethBalance. These updates include:
* - when a transaction changes state to 'submitted', 'confirmed' or 'failed'
* - when the current account changes (i.e. a new account is selected)
- * - when there is a block update
+ * - when there is a block update
*
* @private
*
@@ -100,7 +100,7 @@ class BalanceController {
/**
* Gets the pending transactions (i.e. those with a 'submitted' status). These are accessed from the
- * TransactionController passed to this BalanceController during construction.
+ * TransactionController passed to this BalanceController during construction.
*
* @private
* @returns {Promise<array>} Promises an array of transaction objects.
diff --git a/app/scripts/controllers/blacklist.js b/app/scripts/controllers/blacklist.js
index f100c4525..1d2191433 100644
--- a/app/scripts/controllers/blacklist.js
+++ b/app/scripts/controllers/blacklist.js
@@ -87,7 +87,7 @@ class BlacklistController {
*
* @private
* @param {object} config A config object like that found at {@link https://github.com/MetaMask/eth-phishing-detect/blob/master/src/config.json}
- *
+ *
*/
_setupPhishingDetector (config) {
this._phishingDetector = new PhishingDetector(config)
diff --git a/app/scripts/controllers/computed-balances.js b/app/scripts/controllers/computed-balances.js
index 1a6802f9a..e04ce2ef7 100644
--- a/app/scripts/controllers/computed-balances.js
+++ b/app/scripts/controllers/computed-balances.js
@@ -18,7 +18,7 @@ class ComputedbalancesController {
/**
* Creates a new controller instance
*
- * @param {ComputedBalancesOptions} [opts] Controller configuration parameters
+ * @param {ComputedBalancesOptions} [opts] Controller configuration parameters
*/
constructor (opts = {}) {
const { accountTracker, txController, blockTracker } = opts
diff --git a/app/scripts/controllers/currency.js b/app/scripts/controllers/currency.js
index 480c08b1c..a93aff49b 100644
--- a/app/scripts/controllers/currency.js
+++ b/app/scripts/controllers/currency.js
@@ -16,9 +16,9 @@ class CurrencyController {
* currentCurrency, conversionRate and conversionDate properties
* @property {string} currentCurrency A 2-4 character shorthand that describes a specific currency, currently
* selected by the user
- * @property {number} conversionRate The conversion rate from ETH to the selected currency.
+ * @property {number} conversionRate The conversion rate from ETH to the selected currency.
* @property {string} conversionDate The date at which the conversion rate was set. Expressed in in milliseconds
- * since midnight of January 1, 1970
+ * since midnight of January 1, 1970
* @property {number} conversionInterval The id of the interval created by the scheduleConversionInterval method.
* Used to clear an existing interval on subsequent calls of that method.
*
@@ -59,7 +59,7 @@ class CurrencyController {
/**
* A getter for the conversionRate property
*
- * @returns {string} The conversion rate from ETH to the selected currency.
+ * @returns {string} The conversion rate from ETH to the selected currency.
*
*/
getConversionRate () {
@@ -80,7 +80,7 @@ class CurrencyController {
* A getter for the conversionDate property
*
* @returns {string} The date at which the conversion rate was set. Expressed in milliseconds since midnight of
- * January 1, 1970
+ * January 1, 1970
*
*/
getConversionDate () {
diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js
index 5e0c63e7d..a50f6dc45 100644
--- a/app/scripts/controllers/network/network.js
+++ b/app/scripts/controllers/network/network.js
@@ -132,7 +132,7 @@ module.exports = class NetworkController extends EventEmitter {
} else if (type === LOCALHOST) {
this._configureStandardProvider({ rpcUrl: LOCALHOST_RPC_URL })
// url-based rpc endpoints
- } else if (type === 'rpc'){
+ } else if (type === 'rpc') {
this._configureStandardProvider({ rpcUrl: rpcTarget })
} else {
throw new Error(`NetworkController - _configureProvider - unknown type "${type}"`)
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 8411e3a28..b314745f5 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -111,9 +111,9 @@ class PreferencesController {
* @returns {Promise<string>} selectedAddress the selected address.
*/
syncAddresses (addresses) {
- let { identities, lostIdentities } = this.store.getState()
+ const { identities, lostIdentities } = this.store.getState()
- let newlyLost = {}
+ const newlyLost = {}
Object.keys(identities).forEach((identity) => {
if (!addresses.includes(identity)) {
newlyLost[identity] = identities[identity]
@@ -128,7 +128,7 @@ class PreferencesController {
if (this.diagnostics) this.diagnostics.reportOrphans(newlyLost)
// store lost accounts
- for (let key in newlyLost) {
+ for (const key in newlyLost) {
lostIdentities[key] = newlyLost[key]
}
}
diff --git a/app/scripts/controllers/recent-blocks.js b/app/scripts/controllers/recent-blocks.js
index 033ef1d7e..926268691 100644
--- a/app/scripts/controllers/recent-blocks.js
+++ b/app/scripts/controllers/recent-blocks.js
@@ -117,7 +117,7 @@ class RecentBlocksController {
*
* @returns {Promise<void>} Promises undefined
*/
- async backfill() {
+ async backfill () {
this.blockTracker.once('block', async (block) => {
const currentBlockNumber = Number.parseInt(block.number, 16)
const blocksToFetch = Math.min(currentBlockNumber, this.historyLength)
diff --git a/app/scripts/controllers/transactions/lib/recipient-blacklist-checker.js b/app/scripts/controllers/transactions/lib/recipient-blacklist-checker.js
index 84c6df1f0..e4df2367e 100644
--- a/app/scripts/controllers/transactions/lib/recipient-blacklist-checker.js
+++ b/app/scripts/controllers/transactions/lib/recipient-blacklist-checker.js
@@ -1,4 +1,4 @@
-const Config = require('./recipient-blacklist-config.json')
+const Config = require('./recipient-blacklist.js')
/** @module*/
module.exports = {
diff --git a/app/scripts/controllers/transactions/lib/recipient-blacklist-config.json b/app/scripts/controllers/transactions/lib/recipient-blacklist-config.json
deleted file mode 100644
index b348eb72e..000000000
--- a/app/scripts/controllers/transactions/lib/recipient-blacklist-config.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "blacklist": [
- "0x627306090abab3a6e1400e9345bc60c78a8bef57",
- "0xf17f52151ebef6c7334fad080c5704d77216b732",
- "0xc5fdf4076b8f3a5357c5e395ab970b5b54098fef",
- "0x821aea9a577a9b44299b9c15c88cf3087f3b5544",
- "0x0d1d4e623d10f9fba5db95830f7d3839406c6af2",
- "0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e",
- "0x2191ef87e392377ec08e7c08eb105ef5448eced5",
- "0x0f4f2ac550a1b4e2280d04c21cea7ebd822934b5",
- "0x6330a553fc93768f612722bb8c2ec78ac90b3bbc",
- "0x5aeda56215b167893e80b4fe645ba6d5bab767de"
- ]
-}
diff --git a/app/scripts/controllers/transactions/lib/recipient-blacklist.js b/app/scripts/controllers/transactions/lib/recipient-blacklist.js
new file mode 100644
index 000000000..08e1a2ccd
--- /dev/null
+++ b/app/scripts/controllers/transactions/lib/recipient-blacklist.js
@@ -0,0 +1,17 @@
+module.exports = {
+ 'blacklist': [
+ // IDEX phisher
+ '0x9bcb0A9d99d815Bb87ee3191b1399b1Bcc46dc77',
+ // Ganache default seed phrases
+ '0x627306090abab3a6e1400e9345bc60c78a8bef57',
+ '0xf17f52151ebef6c7334fad080c5704d77216b732',
+ '0xc5fdf4076b8f3a5357c5e395ab970b5b54098fef',
+ '0x821aea9a577a9b44299b9c15c88cf3087f3b5544',
+ '0x0d1d4e623d10f9fba5db95830f7d3839406c6af2',
+ '0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e',
+ '0x2191ef87e392377ec08e7c08eb105ef5448eced5',
+ '0x0f4f2ac550a1b4e2280d04c21cea7ebd822934b5',
+ '0x6330a553fc93768f612722bb8c2ec78ac90b3bbc',
+ '0x5aeda56215b167893e80b4fe645ba6d5bab767de',
+ ],
+}
diff --git a/app/scripts/controllers/transactions/tx-gas-utils.js b/app/scripts/controllers/transactions/tx-gas-utils.js
index 36b5cdbc9..ab4031faa 100644
--- a/app/scripts/controllers/transactions/tx-gas-utils.js
+++ b/app/scripts/controllers/transactions/tx-gas-utils.js
@@ -126,4 +126,4 @@ class TxGasUtil {
}
}
-module.exports = TxGasUtil \ No newline at end of file
+module.exports = TxGasUtil