diff options
Denodeify most of KeyringController
Mostly Fixes #893
A couple methods cache callbacks, and will require a larger refactor to fully denodeify.
Specifically, our methods involving web3 requests to sign a tx, sign a message, and approve or cancel either of those.
I think we should postpone those until the TxManager refactor, since it will likely handle this response caching itself.
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/lib/keyring-controller-test.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/integration/lib/keyring-controller-test.js b/test/integration/lib/keyring-controller-test.js index 678744834..ae5ecc578 100644 --- a/test/integration/lib/keyring-controller-test.js +++ b/test/integration/lib/keyring-controller-test.js @@ -38,8 +38,8 @@ QUnit.test('keyringController:isInitialized', function (assert) { QUnit.test('keyringController:submitPassword', function (assert) { var done = assert.async() - this.keyringController.submitPassword(PASSWORD, (err, state) => { - assert.notOk(err) + this.keyringController.submitPassword(PASSWORD) + .then((state) => { assert.ok(state.identities[FIRST_ADDRESS]) done() }) @@ -49,9 +49,14 @@ QUnit.test('keyringController:setLocked', function (assert) { var done = assert.async() var self = this - this.keyringController.setLocked(function(err) { + this.keyringController.setLocked() + .then(function() { assert.notOk(self.keyringController.password, 'password should be deallocated') assert.deepEqual(self.keyringController.keyrings, [], 'keyrings should be deallocated') done() }) + .catch((reason) => { + assert.ifError(reason) + done() + }) }) |