@metamask-previews/keyring-controller 21.0.6-preview-aa280426 → 21.0.6-preview-88c4fb60

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
@@ -13,10 +13,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
  - The metadata is now stored in each keyring object in the `state.keyrings` array.
14
14
  - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update.
15
15
 
16
- ### Fixed
17
-
18
- - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](https://github.com/MetaMask/core/pull/5775))
19
-
20
16
  ## [21.0.6]
21
17
 
22
18
  ### Changed
@@ -1485,12 +1485,11 @@ async function _KeyringController_unlockKeyrings(password, encryptionKey, encryp
1485
1485
  * Retrieves all the accounts from keyrings instances
1486
1486
  * that are currently in memory.
1487
1487
  *
1488
- * @param additionalKeyrings - Additional keyrings to include in the search.
1489
1488
  * @returns A promise resolving to an array of accounts.
1490
1489
  */
1491
- async function _KeyringController_getAccountsFromKeyrings(additionalKeyrings = []) {
1492
- const keyrings = __classPrivateFieldGet(this, _KeyringController_keyrings, "f").map(({ keyring }) => keyring);
1493
- const keyringArrays = await Promise.all([...keyrings, ...additionalKeyrings].map(async (keyring) => keyring.getAccounts()));
1490
+ async function _KeyringController_getAccountsFromKeyrings() {
1491
+ const keyrings = __classPrivateFieldGet(this, _KeyringController_keyrings, "f");
1492
+ const keyringArrays = await Promise.all(keyrings.map(async ({ keyring }) => keyring.getAccounts()));
1494
1493
  const addresses = keyringArrays.reduce((res, arr) => {
1495
1494
  return res.concat(arr);
1496
1495
  }, []);
@@ -1607,7 +1606,6 @@ async function _KeyringController_restoreKeyring(serialized) {
1607
1606
  let newMetadata = false;
1608
1607
  let metadata = serializedMetadata;
1609
1608
  const keyring = await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_createKeyring).call(this, type, data);
1610
- await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertNoDuplicateAccounts).call(this, [keyring]);
1611
1609
  // If metadata is missing, assume the data is from an installation before
1612
1610
  // we had keyring metadata.
1613
1611
  if (!metadata) {
@@ -1666,11 +1664,10 @@ async function _KeyringController_removeEmptyKeyrings() {
1666
1664
  /**
1667
1665
  * Assert that there are no duplicate accounts in the keyrings.
1668
1666
  *
1669
- * @param additionalKeyrings - Additional keyrings to include in the check.
1670
1667
  * @throws If there are duplicate accounts.
1671
1668
  */
1672
- async function _KeyringController_assertNoDuplicateAccounts(additionalKeyrings = []) {
1673
- const accounts = await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_getAccountsFromKeyrings).call(this, additionalKeyrings);
1669
+ async function _KeyringController_assertNoDuplicateAccounts() {
1670
+ const accounts = await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_getAccountsFromKeyrings).call(this);
1674
1671
  if (new Set(accounts).size !== accounts.length) {
1675
1672
  throw new Error(constants_1.KeyringControllerError.DuplicatedAccount);
1676
1673
  }