diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-06-06 04:35:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-06 04:35:25 +0800 |
commit | 39a7702c8f0aa2c2e7fdf2bcf913e76bb8b827f4 (patch) | |
tree | 3debb11f863bd2d400bebeebc0ed8b0e862ba19a /app/scripts/metamask-controller.js | |
parent | e1cd3562cef92a78945056dc557d4228a72b119c (diff) | |
parent | f73feccf5af76312f9b0a65c42b2bd0877dfba7d (diff) | |
download | tangerine-wallet-browser-39a7702c8f0aa2c2e7fdf2bcf913e76bb8b827f4.tar tangerine-wallet-browser-39a7702c8f0aa2c2e7fdf2bcf913e76bb8b827f4.tar.gz tangerine-wallet-browser-39a7702c8f0aa2c2e7fdf2bcf913e76bb8b827f4.tar.bz2 tangerine-wallet-browser-39a7702c8f0aa2c2e7fdf2bcf913e76bb8b827f4.tar.lz tangerine-wallet-browser-39a7702c8f0aa2c2e7fdf2bcf913e76bb8b827f4.tar.xz tangerine-wallet-browser-39a7702c8f0aa2c2e7fdf2bcf913e76bb8b827f4.tar.zst tangerine-wallet-browser-39a7702c8f0aa2c2e7fdf2bcf913e76bb8b827f4.zip |
Merge pull request #4511 from MetaMask/v4.7.4
Version 4.7.4
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index c753fc06f..1bb0af5ee 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -46,6 +46,7 @@ const GWEI_BN = new BN('1000000000') const percentile = require('percentile') const seedPhraseVerifier = require('./lib/seed-phrase-verifier') const cleanErrorStack = require('./lib/cleanErrorStack') +const DiagnosticsReporter = require('./lib/diagnostics-reporter') const log = require('loglevel') module.exports = class MetamaskController extends EventEmitter { @@ -64,6 +65,12 @@ module.exports = class MetamaskController extends EventEmitter { const initState = opts.initState || {} this.recordFirstTimeInfo(initState) + // metamask diagnostics reporter + this.diagnostics = opts.diagnostics || new DiagnosticsReporter({ + firstTimeInfo: initState.firstTimeInfo, + version, + }) + // platform-specific api this.platform = opts.platform @@ -85,7 +92,7 @@ module.exports = class MetamaskController extends EventEmitter { this.preferencesController = new PreferencesController({ initState: initState.PreferencesController, initLangCode: opts.initLangCode, - getFirstTimeInfo: () => initState.firstTimeInfo, + diagnostics: this.diagnostics, }) // currency controller @@ -487,6 +494,12 @@ module.exports = class MetamaskController extends EventEmitter { await this.keyringController.submitPassword(password) const accounts = await this.keyringController.getAccounts() + // verify keyrings + const nonSimpleKeyrings = this.keyringController.keyrings.filter(keyring => keyring.type !== 'Simple Key Pair') + if (nonSimpleKeyrings.length > 1 && this.diagnostics) { + await this.diagnostics.reportMultipleKeyrings(nonSimpleKeyrings) + } + await this.preferencesController.syncAddresses(accounts) return this.keyringController.fullUpdate() } |