Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Commit ba2c840

Browse files
committed
Fix lint
1 parent 2787442 commit ba2c840

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,10 @@ class KeyringController extends EventEmitter {
617617
if (encryptedVault.includes(VAULT_SEPARATOR)) {
618618
const { salt, vault: vaultOnly } = this.parseVault(encryptedVault);
619619

620-
if (password !== undefined) {
621-
this.encryptionKey = await this._generateEncryptionKey(password, salt);
622-
} else {
620+
if (encryptionKey) {
623621
this.encryptionKey = encryptionKey;
622+
} else {
623+
this.encryptionKey = await this._generateEncryptionKey(password, salt);
624624
}
625625

626626
return await this.encryptor.decrypt(this.encryptionKey, vaultOnly);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"browser-passworder": "^2.0.3",
3737
"eth-sig-util": "^3.0.1",
3838
"eth-simple-keyring": "^4.2.0",
39-
"obs-store": "^4.0.3",
40-
"ethereum-cryptography": "^1.1.2"
39+
"ethereum-cryptography": "^1.1.2",
40+
"obs-store": "^4.0.3"
4141
},
4242
"devDependencies": {
4343
"@lavamoat/allow-scripts": "^1.0.6",

test/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('KeyringController', function () {
112112
await keyringController.createNewVaultAndKeychain(PASSWORD);
113113
const { vault } = keyringController.store.getState();
114114
// eslint-disable-next-line jest/no-restricted-matchers
115-
expect(vault).toBeTruthy();
115+
expect(Boolean(vault)).toBe(true);
116116
});
117117

118118
it('should encrypt keyrings with the correct password each time they are persisted', async function () {
@@ -486,6 +486,7 @@ describe('KeyringController', function () {
486486
// Attempt to verify the password
487487
await expect(
488488
keyringController.verifyPassword(PASSWORD),
489+
// eslint-disable-next-line jest/no-restricted-matchers
489490
).resolves.toBeTruthy();
490491
});
491492

@@ -496,6 +497,7 @@ describe('KeyringController', function () {
496497
// Attempt to unlock the keychaing via old password
497498
await expect(
498499
keyringController.submitPassword(PASSWORD),
500+
// eslint-disable-next-line jest/no-restricted-matchers
499501
).resolves.toBeTruthy();
500502

501503
// Ensure the new vault value has separator and salt

0 commit comments

Comments
 (0)