From ab9e15b782620002c0a2477829db3e56a25a7d5c Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 8 Dec 2016 14:22:02 -0800 Subject: Mostly added bad account detection Currently riddled with logs, because the migrator is inexplicably returning before generating the new style accounts for comparison. --- test/unit/idStore-migration-test.js | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'test/unit/idStore-migration-test.js') diff --git a/test/unit/idStore-migration-test.js b/test/unit/idStore-migration-test.js index ac8e23d22..2ea5cc36f 100644 --- a/test/unit/idStore-migration-test.js +++ b/test/unit/idStore-migration-test.js @@ -21,6 +21,10 @@ const mockVault = { account: '0x5d8de92c205279c10e5669f797b853ccef4f739a', } +const badVault = { + seed: 'radar blur cabbage chef fix engine embark joy scheme fiction master release', +} + describe('IdentityStore to KeyringController migration', function() { // The stars of the show: @@ -79,33 +83,9 @@ describe('IdentityStore to KeyringController migration', function() { keyringController.configManager.setWallet('something') const state = keyringController.getState() assert(state.isInitialized, 'old vault counted as initialized.') + console.dir(state) + assert.equal(state.lostAccounts.length, 0, 'no lost accounts') }) - - /* - it('should use the password to migrate the old vault', function(done) { - this.timeout(5000) - console.log('calling submitPassword') - console.dir(keyringController) - keyringController.submitPassword(password, function (err, state) { - assert.ifError(err, 'submitPassword threw error') - - function log(str, dat) { console.log(str + ': ' + JSON.stringify(dat)) } - - let newAccounts = keyringController.getAccounts() - log('new accounts: ', newAccounts) - - let newAccount = ethUtil.addHexPrefix(newAccounts[0]) - assert.equal(ethUtil.addHexPrefix(newAccount), mockVault.account, 'restored the correct account') - const newSeed = keyringController.keyrings[0].mnemonic - log('keyringController keyrings', keyringController.keyrings) - assert.equal(newSeed, mockVault.seed, 'seed phrase transferred.') - - assert(configManager.getVault(), 'new type of vault is persisted') - done() - }) - }) - */ - }) }) -- cgit From 20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 19 Dec 2016 16:29:44 -0800 Subject: Made changes according to feedback. --- test/unit/idStore-migration-test.js | 1 - 1 file changed, 1 deletion(-) (limited to 'test/unit/idStore-migration-test.js') diff --git a/test/unit/idStore-migration-test.js b/test/unit/idStore-migration-test.js index 2ea5cc36f..66dd4683d 100644 --- a/test/unit/idStore-migration-test.js +++ b/test/unit/idStore-migration-test.js @@ -83,7 +83,6 @@ describe('IdentityStore to KeyringController migration', function() { keyringController.configManager.setWallet('something') const state = keyringController.getState() assert(state.isInitialized, 'old vault counted as initialized.') - console.dir(state) assert.equal(state.lostAccounts.length, 0, 'no lost accounts') }) }) -- cgit