diff options
author | Bruno Barbieri <brunobar79@gmail.com> | 2018-11-27 02:27:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-27 02:27:49 +0800 |
commit | f2066432baa5af4f63a5687800bb524959b27af3 (patch) | |
tree | f31dceb33f5df78585290961b3212017e30e788b /app/scripts | |
parent | fb94c1bae7d4f500ef78b2f93ada44ef640d38e4 (diff) | |
download | tangerine-wallet-browser-f2066432baa5af4f63a5687800bb524959b27af3.tar tangerine-wallet-browser-f2066432baa5af4f63a5687800bb524959b27af3.tar.gz tangerine-wallet-browser-f2066432baa5af4f63a5687800bb524959b27af3.tar.bz2 tangerine-wallet-browser-f2066432baa5af4f63a5687800bb524959b27af3.tar.lz tangerine-wallet-browser-f2066432baa5af4f63a5687800bb524959b27af3.tar.xz tangerine-wallet-browser-f2066432baa5af4f63a5687800bb524959b27af3.tar.zst tangerine-wallet-browser-f2066432baa5af4f63a5687800bb524959b27af3.zip |
Use Array.includes
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/metamask-controller.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 2cffa15c2..7d6f06f92 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -50,6 +50,7 @@ const seedPhraseVerifier = require('./lib/seed-phrase-verifier') const log = require('loglevel') const TrezorKeyring = require('eth-trezor-keyring') const LedgerBridgeKeyring = require('eth-ledger-bridge-keyring') +const HW_WALLETS_KEYRINGS = [TrezorKeyring.type, LedgerBridgeKeyring.type] const EthQuery = require('eth-query') const ethUtil = require('ethereumjs-util') const sigUtil = require('eth-sig-util') @@ -1021,15 +1022,14 @@ module.exports = class MetamaskController extends EventEmitter { log.info('MetaMaskController - eth_signTypedData') const msgId = msgParams.metamaskId const version = msgParams.version - const HW_WALLETS_KEYRINGS = [TrezorKeyring.type, LedgerBridgeKeyring.type] try { const cleanMsgParams = await this.typedMessageManager.approveMessage(msgParams) const address = sigUtil.normalize(cleanMsgParams.from) const keyring = await this.keyringController.getKeyringForAccount(address) let signature - // HW Wallet keyrings don't expose private keys so - // we need to handle it separately - if (HW_WALLETS_KEYRINGS.indexOf(keyring.type) === -1) { + // HW Wallet keyrings don't expose private keys + // so we need to handle it separately + if (!HW_WALLETS_KEYRINGS.includes(keyring.type)) { const wallet = keyring._getWalletForAccount(address) const privKey = ethUtil.toBuffer(wallet.getPrivateKey()) switch (version) { |