From c0d3db6a8ce2fe0522fa4e3cba1e01d10469280f Mon Sep 17 00:00:00 2001 From: kumavis Date: Tue, 31 Jan 2017 20:02:38 -0800 Subject: keyring - synchronous getState --- test/unit/idStore-migration-test.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/unit/idStore-migration-test.js b/test/unit/idStore-migration-test.js index 3aaf4bb94..1537e88ec 100644 --- a/test/unit/idStore-migration-test.js +++ b/test/unit/idStore-migration-test.js @@ -83,15 +83,10 @@ describe('IdentityStore to KeyringController migration', function() { describe('entering a password', function() { it('should identify an old wallet as an initialized keyring', function(done) { keyringController.configManager.setWallet('something') - keyringController.getState() - .then((state) => { - assert(state.isInitialized, 'old vault counted as initialized.') - assert(!state.lostAccounts, 'no lost accounts') - done() - }) - .catch((err) => { - done(err) - }) + const state = keyringController.getState() + assert(state.isInitialized, 'old vault counted as initialized.') + assert(!state.lostAccounts, 'no lost accounts') + done() }) }) }) -- cgit From cd5d95260026333735f25a179c7018077e0da44e Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 1 Feb 2017 00:17:48 -0800 Subject: keyring - move identities into memStore --- test/unit/keyring-controller-test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/unit/keyring-controller-test.js b/test/unit/keyring-controller-test.js index 347aa2bdf..aae4cdfd6 100644 --- a/test/unit/keyring-controller-test.js +++ b/test/unit/keyring-controller-test.js @@ -104,7 +104,7 @@ describe('KeyringController', function() { it('should add the address to the identities hash', function() { const fakeAddress = '0x12345678' keyringController.createNickname(fakeAddress) - const identities = keyringController.identities + const identities = keyringController.memStore.getState().identities const identity = identities[fakeAddress] assert.equal(identity.address, fakeAddress) }) @@ -114,7 +114,9 @@ describe('KeyringController', function() { it ('sets the nickname', function(done) { const account = addresses[0] var nick = 'Test nickname' - keyringController.identities[ethUtil.addHexPrefix(account)] = {} + const identities = keyringController.memStore.getState().identities + identities[ethUtil.addHexPrefix(account)] = {} + keyringController.memStore.updateState({ identities }) keyringController.saveAccountLabel(account, nick) .then((label) => { try { -- cgit From 1cb730144d6b1c05007323bbc31e4375373628fb Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 1 Feb 2017 00:31:26 -0800 Subject: metamask - adopt isInitialized from keyring controller --- test/unit/idStore-migration-test.js | 9 --------- 1 file changed, 9 deletions(-) (limited to 'test') diff --git a/test/unit/idStore-migration-test.js b/test/unit/idStore-migration-test.js index 1537e88ec..81a99ef63 100644 --- a/test/unit/idStore-migration-test.js +++ b/test/unit/idStore-migration-test.js @@ -80,13 +80,4 @@ describe('IdentityStore to KeyringController migration', function() { }) }) - describe('entering a password', function() { - it('should identify an old wallet as an initialized keyring', function(done) { - keyringController.configManager.setWallet('something') - const state = keyringController.getState() - assert(state.isInitialized, 'old vault counted as initialized.') - assert(!state.lostAccounts, 'no lost accounts') - done() - }) - }) }) -- cgit