diff options
author | bitpshr <mail@bitpshr.net> | 2019-05-07 00:12:52 +0800 |
---|---|---|
committer | bitpshr <mail@bitpshr.net> | 2019-05-09 05:56:52 +0800 |
commit | 77d3bc252d5c4d223e9de3c6700750d1895bb257 (patch) | |
tree | 65721e69275db7cd28979aafb58bc38e74215e10 /app/scripts/metamask-controller.js | |
parent | 094e4cf555c698bfef50ca6679cd1e98f4ea9aa1 (diff) | |
download | tangerine-wallet-browser-77d3bc252d5c4d223e9de3c6700750d1895bb257.tar.gz tangerine-wallet-browser-77d3bc252d5c4d223e9de3c6700750d1895bb257.tar.zst tangerine-wallet-browser-77d3bc252d5c4d223e9de3c6700750d1895bb257.zip |
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 b190dd452..447d8b626 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) } /** |