diff options
author | Bruno Barbieri <bruno.barbieri@consensys.net> | 2018-08-21 22:48:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-21 22:48:40 +0800 |
commit | 282820c93a00176dc3b0e5c3b9c06256a10a443e (patch) | |
tree | 9d7253165a413e5e3cb0995f933c2d8f9ee5e748 | |
parent | 887cad973f25f43d2d4502ff31657f156a44b188 (diff) | |
parent | 54021fd90b9a37cc4120021d475d0c98dfaefbb0 (diff) | |
download | tangerine-wallet-browser-282820c93a00176dc3b0e5c3b9c06256a10a443e.tar tangerine-wallet-browser-282820c93a00176dc3b0e5c3b9c06256a10a443e.tar.gz tangerine-wallet-browser-282820c93a00176dc3b0e5c3b9c06256a10a443e.tar.bz2 tangerine-wallet-browser-282820c93a00176dc3b0e5c3b9c06256a10a443e.tar.lz tangerine-wallet-browser-282820c93a00176dc3b0e5c3b9c06256a10a443e.tar.xz tangerine-wallet-browser-282820c93a00176dc3b0e5c3b9c06256a10a443e.tar.zst tangerine-wallet-browser-282820c93a00176dc3b0e5c3b9c06256a10a443e.zip |
Merge pull request #5112 from MetaMask/hardware-wallet-fixes
Hardware wallet fixes
-rw-r--r-- | app/scripts/metamask-controller.js | 7 | ||||
-rw-r--r-- | test/unit/app/controllers/metamask-controller-test.js | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 2d7d2c671..29838ad2d 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -668,7 +668,9 @@ module.exports = class MetamaskController extends EventEmitter { this.preferencesController.setAddresses(newAccounts) newAccounts.forEach(address => { if (!oldAccounts.includes(address)) { - this.preferencesController.setAccountLabel(address, `${deviceName.toUpperCase()} ${parseInt(index, 10) + 1}`) + // Set the account label to Trezor 1 / Ledger 1, etc + this.preferencesController.setAccountLabel(address, `${deviceName[0].toUpperCase()}${deviceName.slice(1)} ${parseInt(index, 10) + 1}`) + // Select the account this.preferencesController.setSelectedAddress(address) } }) @@ -800,7 +802,8 @@ module.exports = class MetamaskController extends EventEmitter { // Remove account from the preferences controller this.preferencesController.removeAddress(address) // Remove account from the account tracker controller - this.accountTracker.removeAccount(address) + this.accountTracker.removeAccount([address]) + // Remove account from the keyring await this.keyringController.removeAccount(address) return address diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js index 1fc604c9c..a798d41e2 100644 --- a/test/unit/app/controllers/metamask-controller-test.js +++ b/test/unit/app/controllers/metamask-controller-test.js @@ -573,7 +573,7 @@ describe('MetaMaskController', function () { assert(metamaskController.preferencesController.removeAddress.calledWith(addressToRemove)) }) it('should call accountTracker.removeAccount', async function () { - assert(metamaskController.accountTracker.removeAccount.calledWith(addressToRemove)) + assert(metamaskController.accountTracker.removeAccount.calledWith([addressToRemove])) }) it('should call keyringController.removeAccount', async function () { assert(metamaskController.keyringController.removeAccount.calledWith(addressToRemove)) |