aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/metamask-controller-test.js
diff options
context:
space:
mode:
authorDan Finlay <542863+danfinlay@users.noreply.github.com>2019-05-15 04:22:54 +0800
committerGitHub <noreply@github.com>2019-05-15 04:22:54 +0800
commitbf5b7f8e77684ce4a66d7e0301ed19d048a545f9 (patch)
tree9c68af7d6cb4b10410d5deeb33b9c9b61996cd02 /test/unit/app/controllers/metamask-controller-test.js
parent7dcc707a4329d69e9d4d7c6befbfd228ed7d714b (diff)
parent985f51a764560311e8aa5bb149e34b3c25b78c92 (diff)
downloadtangerine-wallet-browser-bf5b7f8e77684ce4a66d7e0301ed19d048a545f9.tar.gz
tangerine-wallet-browser-bf5b7f8e77684ce4a66d7e0301ed19d048a545f9.tar.zst
tangerine-wallet-browser-bf5b7f8e77684ce4a66d7e0301ed19d048a545f9.zip
Merge pull request #6599 from MetaMask/develop
Master Version Bump (v6.5.0)
Diffstat (limited to 'test/unit/app/controllers/metamask-controller-test.js')
-rw-r--r--test/unit/app/controllers/metamask-controller-test.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js
index 1ed6a95fb..a56b8adbd 100644
--- a/test/unit/app/controllers/metamask-controller-test.js
+++ b/test/unit/app/controllers/metamask-controller-test.js
@@ -49,7 +49,7 @@ describe('MetaMaskController', function () {
showUnapprovedTx: noop,
showUnconfirmedMessage: noop,
encryptor: {
- encrypt: function (password, object) {
+ encrypt: function (_, object) {
this.object = object
return Promise.resolve('mock-encrypted')
},
@@ -144,7 +144,7 @@ describe('MetaMaskController', function () {
sandbox.stub(metamaskController, 'getBalance')
metamaskController.getBalance.callsFake(() => { return Promise.resolve('0x0') })
- await metamaskController.createNewVaultAndRestore(password, TEST_SEED.slice(0, -1)).catch((e) => null)
+ await metamaskController.createNewVaultAndRestore(password, TEST_SEED.slice(0, -1)).catch(() => null)
await metamaskController.createNewVaultAndRestore(password, TEST_SEED)
assert(metamaskController.keyringController.createNewVaultAndRestore.calledTwice)
@@ -207,7 +207,7 @@ describe('MetaMaskController', function () {
const accounts = {}
const balance = '0x14ced5122ce0a000'
const ethQuery = new EthQuery()
- sinon.stub(ethQuery, 'getBalance').callsFake((account, callback) => {
+ sinon.stub(ethQuery, 'getBalance').callsFake((_, callback) => {
callback(undefined, balance)
})
@@ -295,7 +295,7 @@ describe('MetaMaskController', function () {
it('should add the Trezor Hardware keyring', async function () {
sinon.spy(metamaskController.keyringController, 'addNewKeyring')
- await metamaskController.connectHardware('trezor', 0).catch((e) => null)
+ await metamaskController.connectHardware('trezor', 0).catch(() => null)
const keyrings = await metamaskController.keyringController.getKeyringsByType(
'Trezor Hardware'
)
@@ -305,7 +305,7 @@ describe('MetaMaskController', function () {
it('should add the Ledger Hardware keyring', async function () {
sinon.spy(metamaskController.keyringController, 'addNewKeyring')
- await metamaskController.connectHardware('ledger', 0).catch((e) => null)
+ await metamaskController.connectHardware('ledger', 0).catch(() => null)
const keyrings = await metamaskController.keyringController.getKeyringsByType(
'Ledger Hardware'
)
@@ -325,7 +325,7 @@ describe('MetaMaskController', function () {
})
it('should be locked by default', async function () {
- await metamaskController.connectHardware('trezor', 0).catch((e) => null)
+ await metamaskController.connectHardware('trezor', 0).catch(() => null)
const status = await metamaskController.checkHardwareStatus('trezor')
assert.equal(status, false)
})
@@ -341,7 +341,7 @@ describe('MetaMaskController', function () {
})
it('should wipe all the keyring info', async function () {
- await metamaskController.connectHardware('trezor', 0).catch((e) => null)
+ await metamaskController.connectHardware('trezor', 0).catch(() => null)
await metamaskController.forgetDevice('trezor')
const keyrings = await metamaskController.keyringController.getKeyringsByType(
'Trezor Hardware'
@@ -376,7 +376,7 @@ describe('MetaMaskController', function () {
sinon.spy(metamaskController.preferencesController, 'setAddresses')
sinon.spy(metamaskController.preferencesController, 'setSelectedAddress')
sinon.spy(metamaskController.preferencesController, 'setAccountLabel')
- await metamaskController.connectHardware('trezor', 0, `m/44/0'/0'`).catch((e) => null)
+ await metamaskController.connectHardware('trezor', 0, `m/44/0'/0'`).catch(() => null)
await metamaskController.unlockHardwareWalletAccount(accountToUnlock, 'trezor', `m/44/0'/0'`)
})
@@ -464,7 +464,7 @@ describe('MetaMaskController', function () {
depositAddress = '3EevLFfB4H4XMWQwYCgjLie1qCAGpd2WBc'
depositType = 'ETH'
- shapeShiftTxList = metamaskController.shapeshiftController.store.getState().shapeShiftTxList
+ shapeShiftTxList = metamaskController.shapeshiftController.state.shapeShiftTxList
})
it('creates a shapeshift tx', async function () {
@@ -752,12 +752,11 @@ describe('MetaMaskController', function () {
})
it('sets up phishing stream for untrusted communication ', async () => {
- await metamaskController.blacklistController.updatePhishingList()
- console.log(blacklistJSON.blacklist.includes(phishingUrl))
+ await metamaskController.phishingController.updatePhishingLists()
const { promise, resolve } = deferredPromise()
- streamTest = createThoughStream((chunk, enc, cb) => {
+ streamTest = createThoughStream((chunk, _, cb) => {
if (chunk.name !== 'phishing') return cb()
assert.equal(chunk.data.hostname, phishingUrl)
resolve()
@@ -777,7 +776,7 @@ describe('MetaMaskController', function () {
})
it('sets up controller dnode api for trusted communication', function (done) {
- streamTest = createThoughStream((chunk, enc, cb) => {
+ streamTest = createThoughStream((chunk, _, cb) => {
assert.equal(chunk.name, 'controller')
cb()
done()