aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-12-21 03:50:26 +0800
committerGitHub <noreply@github.com>2016-12-21 03:50:26 +0800
commit674b2689826c770092a3dfee7fe76fb83c0b444a (patch)
tree96dd32380a338c361131aae49a8f664308a591f0 /test/unit
parent4fbea1c7b4e3ca13b76aa49c7a349a3dc2366910 (diff)
parent20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b (diff)
downloadtangerine-wallet-browser-674b2689826c770092a3dfee7fe76fb83c0b444a.tar
tangerine-wallet-browser-674b2689826c770092a3dfee7fe76fb83c0b444a.tar.gz
tangerine-wallet-browser-674b2689826c770092a3dfee7fe76fb83c0b444a.tar.bz2
tangerine-wallet-browser-674b2689826c770092a3dfee7fe76fb83c0b444a.tar.lz
tangerine-wallet-browser-674b2689826c770092a3dfee7fe76fb83c0b444a.tar.xz
tangerine-wallet-browser-674b2689826c770092a3dfee7fe76fb83c0b444a.tar.zst
tangerine-wallet-browser-674b2689826c770092a3dfee7fe76fb83c0b444a.zip
Merge pull request #916 from MetaMask/i894-DetectBadAccounts
I894 detect bad accounts
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/idStore-migration-test.js31
-rw-r--r--test/unit/keyring-controller-test.js15
2 files changed, 5 insertions, 41 deletions
diff --git a/test/unit/idStore-migration-test.js b/test/unit/idStore-migration-test.js
index ac8e23d22..66dd4683d 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,8 @@ describe('IdentityStore to KeyringController migration', function() {
keyringController.configManager.setWallet('something')
const state = keyringController.getState()
assert(state.isInitialized, 'old vault counted as initialized.')
+ 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()
- })
- })
- */
-
})
})
diff --git a/test/unit/keyring-controller-test.js b/test/unit/keyring-controller-test.js
index 69a57ef52..8bb1126fa 100644
--- a/test/unit/keyring-controller-test.js
+++ b/test/unit/keyring-controller-test.js
@@ -95,21 +95,6 @@ describe('KeyringController', function() {
})
})
- describe('#migrateOldVaultIfAny', function() {
- it('should return and init a new vault', function(done) {
- keyringController.migrateOldVaultIfAny(password)
- .then(() => {
- assert(keyringController.configManager.getVault(), 'now has a vault')
- assert(keyringController.password, 'has a password set')
- done()
- })
- .catch((reason) => {
- assert.ifError(reason)
- done()
- })
- })
- })
-
describe('#createNickname', function() {
it('should add the address to the identities hash', function() {
const fakeAddress = '0x12345678'