diff options
Add additional migration test
Diffstat (limited to 'test/integration/lib')
-rw-r--r-- | test/integration/lib/idStore-migrator-test.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/integration/lib/idStore-migrator-test.js b/test/integration/lib/idStore-migrator-test.js index 338896171..4ae30411d 100644 --- a/test/integration/lib/idStore-migrator-test.js +++ b/test/integration/lib/idStore-migrator-test.js @@ -1,6 +1,7 @@ -var KeyringController = require('../../../app/scripts/keyring-controller') var ConfigManager = require('../../../app/scripts/lib/config-manager') var IdStoreMigrator = require('../../../app/scripts/lib/idStore-migrator') +var SimpleKeyring = require('../../../app/scripts/keyrings/simple') +var normalize = require('../../../app/scripts/lib/sig-util').normalize var oldStyleVault = require('../mocks/oldVault.json') var badStyleVault = require('../mocks/badVault.json') @@ -68,7 +69,23 @@ QUnit.test('migrator:migratedVaultForPassword', function (assert) { assert.equal(lostAccounts.length, 1, 'one lost account') assert.equal(lostAccounts[0].address, '0xe15D894BeCB0354c501AE69429B05143679F39e0'.toLowerCase()) assert.ok(lostAccounts[0].privateKey, 'private key exported') - done() + + var lostAccount = lostAccounts[0] + var privateKey = lostAccount.privateKey + + var simple = new SimpleKeyring() + simple.deserialize([privateKey]) + .then(() => { + return simple.getAccounts() + }) + .then((accounts) => { + assert.equal(normalize(accounts[0]), lostAccount.address, 'recovered address.') + done() + }) + .catch((reason) => { + assert.ifError(reason) + done(reason) + }) }) }) |