Skip to content

Commit da45794

Browse files
authored
Return fullUpdate from methods it used to (MetaMask#161)
1 parent d3d68a8 commit da45794

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class KeyringController extends EventEmitter {
8888

8989
await this.createFirstKeyTree();
9090
this.setUnlocked();
91-
this.fullUpdate();
91+
return this.fullUpdate();
9292
}
9393

9494
/**
@@ -182,7 +182,7 @@ class KeyringController extends EventEmitter {
182182
this.keyrings = await this.unlockKeyrings(password);
183183

184184
this.setUnlocked();
185-
this.fullUpdate();
185+
return this.fullUpdate();
186186
}
187187

188188
/**
@@ -203,7 +203,7 @@ class KeyringController extends EventEmitter {
203203
encryptionSalt,
204204
);
205205
this.setUnlocked();
206-
this.fullUpdate();
206+
return this.fullUpdate();
207207
}
208208

209209
/**
@@ -330,7 +330,7 @@ class KeyringController extends EventEmitter {
330330
});
331331

332332
await this.persistAllKeyrings();
333-
this.fullUpdate();
333+
return this.fullUpdate();
334334
}
335335

336336
/**
@@ -379,7 +379,7 @@ class KeyringController extends EventEmitter {
379379
}
380380

381381
await this.persistAllKeyrings();
382-
this.fullUpdate();
382+
return this.fullUpdate();
383383
}
384384

385385
//

test/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ describe('KeyringController', function () {
9999
keyringController.store.updateState({ vault: null });
100100
assert(!keyringController.store.getState().vault, 'no previous vault');
101101

102-
await keyringController.createNewVaultAndKeychain(password);
102+
const newVault = await keyringController.createNewVaultAndKeychain(
103+
password,
104+
);
103105
const { vault } = keyringController.store.getState();
104-
// eslint-disable-next-line jest/no-restricted-matchers
105-
expect(vault).toBeTruthy();
106+
expect(vault).toStrictEqual(expect.stringMatching('.+'));
107+
expect(typeof newVault).toBe('object');
106108
});
107109

108110
it('should unlock the vault', async function () {

0 commit comments

Comments
 (0)