aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-07 03:10:43 +0800
committerDan <danjm.com@gmail.com>2018-06-07 03:10:43 +0800
commitae55e8a3c122a3f6d91e28153124bfb6a13ded84 (patch)
treeb23043409b2877bce4096d411f3c3273a610b146 /app/scripts/metamask-controller.js
parentaee9247faab984734d2f0278baaf768e2a7926d2 (diff)
parent1fb408f62eb081311937420bb42da6c835510590 (diff)
downloadtangerine-wallet-browser-ae55e8a3c122a3f6d91e28153124bfb6a13ded84.tar
tangerine-wallet-browser-ae55e8a3c122a3f6d91e28153124bfb6a13ded84.tar.gz
tangerine-wallet-browser-ae55e8a3c122a3f6d91e28153124bfb6a13ded84.tar.bz2
tangerine-wallet-browser-ae55e8a3c122a3f6d91e28153124bfb6a13ded84.tar.lz
tangerine-wallet-browser-ae55e8a3c122a3f6d91e28153124bfb6a13ded84.tar.xz
tangerine-wallet-browser-ae55e8a3c122a3f6d91e28153124bfb6a13ded84.tar.zst
tangerine-wallet-browser-ae55e8a3c122a3f6d91e28153124bfb6a13ded84.zip
Merge branch 'develop' into i3725-refactor-send-component-
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 80eaafd92..532cfbd61 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
@@ -489,6 +496,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()
}