@metamask-previews/keyring-controller 21.0.2-preview-51fc474a → 21.0.2-preview-13a1c613

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Changed
11
+
12
+ - `ExportableKeyEncryptor` is now a generic type with a type parameter `EncryptionKey` ([#5395](https://github.com/MetaMask/core/pull/5395))
13
+ - The type parameter defaults to `unknown`
14
+
15
+ ### Fixed
16
+
17
+ - Fixed wrong error message thrown when using the wrong password ([#5627](https://github.com/MetaMask/core/pull/5627))
18
+
10
19
  ## [21.0.2]
11
20
 
12
21
  ### Changed
@@ -1295,9 +1295,6 @@ async function _KeyringController_restoreSerializedKeyrings(serializedKeyrings)
1295
1295
  for (const serializedKeyring of serializedKeyrings) {
1296
1296
  await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_restoreKeyring).call(this, serializedKeyring);
1297
1297
  }
1298
- if (__classPrivateFieldGet(this, _KeyringController_keyrings, "f").length !== __classPrivateFieldGet(this, _KeyringController_keyringsMetadata, "f").length) {
1299
- throw new Error(constants_1.KeyringControllerError.KeyringMetadataLengthMismatch);
1300
- }
1301
1298
  }, _KeyringController_unlockKeyrings =
1302
1299
  /**
1303
1300
  * Unlock Keyrings, decrypting the vault and deserializing all
@@ -1355,6 +1352,11 @@ async function _KeyringController_unlockKeyrings(password, encryptionKey, encryp
1355
1352
  throw new Error(constants_1.KeyringControllerError.VaultDataError);
1356
1353
  }
1357
1354
  await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_restoreSerializedKeyrings).call(this, vault);
1355
+ // The keyrings array and the keyringsMetadata array should
1356
+ // always have the same length while the controller is unlocked.
1357
+ if (__classPrivateFieldGet(this, _KeyringController_keyrings, "f").length !== __classPrivateFieldGet(this, _KeyringController_keyringsMetadata, "f").length) {
1358
+ throw new Error(constants_1.KeyringControllerError.KeyringMetadataLengthMismatch);
1359
+ }
1358
1360
  const updatedKeyrings = await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_getUpdatedKeyrings).call(this);
1359
1361
  this.update((state) => {
1360
1362
  state.keyrings = updatedKeyrings;