diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-01-25 04:28:05 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2017-01-25 04:28:05 +0800 |
commit | 48ffea0142bf68a49f30887b3509786d7e751895 (patch) | |
tree | 48eaa3ecf81cbdbf14c78316b43b3f9f29a5741c /app/scripts/metamask-controller.js | |
parent | 8642ced310890c7a3202a2826a2c74fad1fefca3 (diff) | |
download | tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.gz tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.bz2 tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.lz tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.xz tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.zst tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.zip |
Move the assumption of their only being one hd keyring when requesting seed words to metamaskController
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 6b6424f2a..a235be75b 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -107,7 +107,11 @@ module.exports = class MetamaskController extends EventEmitter { // forward directly to keyringController createNewVaultAndKeychain: nodeify(keyringController.createNewVaultAndKeychain).bind(keyringController), createNewVaultAndRestore: nodeify(keyringController.createNewVaultAndRestore).bind(keyringController), - placeSeedWords: nodeify(keyringController.placeSeedWords).bind(keyringController), + placeSeedWords: (cb) => { + const primaryKeyring = keyringController.getKeyringsByType('HD Key Tree')[0] + if (!primaryKeyring) return cb(new Error('MetamaskController - No HD Key Tree found')) + promiseToCallback(keyringController.placeSeedWords(primaryKeyring))(cb) + }, clearSeedWordCache: nodeify(keyringController.clearSeedWordCache).bind(keyringController), setLocked: nodeify(keyringController.setLocked).bind(keyringController), submitPassword: (password, cb) => { |