This repository was archived by the owner on Oct 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments