diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2019-05-11 04:43:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-11 04:43:20 +0800 |
commit | 08e8fb21dc142ab21184c1125f55b9f3e0ce6412 (patch) | |
tree | 258cc03afd6ab8036606c06bc323481175a660de /app/scripts/metamask-controller.js | |
parent | 0cdce533e2e9368b6aa9b37e85dd1f4cc33395aa (diff) | |
parent | 77d3bc252d5c4d223e9de3c6700750d1895bb257 (diff) | |
download | tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.gz tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.bz2 tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.lz tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.xz tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.zst tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.zip |
Merge pull request #6568 from MetaMask/feature/gaba-phishing-controller
feature: integrate gaba/PhishingController
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index cc9d51d3c..bdfff9827 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -28,7 +28,6 @@ const PreferencesController = require('./controllers/preferences') const CurrencyController = require('./controllers/currency') const ShapeShiftController = require('./controllers/shapeshift') const InfuraController = require('./controllers/infura') -const BlacklistController = require('./controllers/blacklist') const CachedBalancesController = require('./controllers/cached-balances') const RecentBlocksController = require('./controllers/recent-blocks') const MessageManager = require('./lib/message-manager') @@ -55,7 +54,10 @@ const HW_WALLETS_KEYRINGS = [TrezorKeyring.type, LedgerBridgeKeyring.type] const EthQuery = require('eth-query') const ethUtil = require('ethereumjs-util') const sigUtil = require('eth-sig-util') -const { AddressBookController } = require('gaba') +const { + AddressBookController, + PhishingController, +} = require('gaba') const backEndMetaMetricsEvent = require('./lib/backend-metametrics') @@ -112,8 +114,7 @@ module.exports = class MetamaskController extends EventEmitter { }) this.infuraController.scheduleInfuraNetworkCheck() - this.blacklistController = new BlacklistController() - this.blacklistController.scheduleUpdates() + this.phishingController = new PhishingController() // rpc provider this.initializeProvider() @@ -1301,7 +1302,7 @@ module.exports = class MetamaskController extends EventEmitter { */ setupUntrustedCommunication (connectionStream, originDomain) { // Check if new connection is blacklisted - if (this.blacklistController.checkForPhishing(originDomain)) { + if (this.phishingController.test(originDomain)) { log.debug('MetaMask - sending phishing warning for', originDomain) this.sendPhishingWarning(connectionStream, originDomain) return @@ -1781,11 +1782,11 @@ module.exports = class MetamaskController extends EventEmitter { */ /** - * Adds a domain to the {@link BlacklistController} whitelist + * Adds a domain to the PhishingController whitelist * @param {string} hostname the domain to whitelist */ whitelistPhishingDomain (hostname) { - return this.blacklistController.whitelistDomain(hostname) + return this.phishingController.bypass(hostname) } /** |