Skip to content

KeyringController: select only supported properties in fullUpdate#1710

Merged
mikesposito merged 1 commit intomainfrom
fix/keyring-controller-keyring-types
Sep 27, 2023
Merged

KeyringController: select only supported properties in fullUpdate#1710
mikesposito merged 1 commit intomainfrom
fix/keyring-controller-keyring-types

Conversation

@mikesposito
Copy link
Member

Explanation

The property keyringTypes has been removed from KeyringController's store, but as EthKeyringController still has this property in its memStore, and as in the KeyringController.#fullUpdate we destructure the entire object, we also carry over keyringTypes - a property we don't have metadata for.

This PR changes the #fullUpdate internal method to only take these properties from EthKeyringController stores:

  • vault
  • keyrings
  • isUnlocked
  • encryptionKey
  • encryptionSalt

References

Changelog

@metamask/keyring-controller

  • FIXED: Removed keyringTypes from updated properties from EthKeyringController stores

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@mikesposito mikesposito requested a review from a team as a code owner September 25, 2023 12:00
@mikesposito mikesposito changed the title fix: select only supported properties in fullUpdate KeyringController: select only supported properties in fullUpdate Sep 25, 2023
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mikesposito mikesposito force-pushed the fix/keyring-controller-keyring-types branch from 7aea835 to b8e8092 Compare September 27, 2023 15:18
@mikesposito mikesposito merged commit 7316e61 into main Sep 27, 2023
@mikesposito mikesposito deleted the fix/keyring-controller-keyring-types branch September 27, 2023 15:25
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
…#1710)

## Explanation
The property `keyringTypes` has been removed from `KeyringController`'s
store, but as `EthKeyringController` still has this property in its
`memStore`, and as in the `KeyringController.#fullUpdate` we destructure
the entire object, we also carry over `keyringTypes` - a property we
don't have metadata for.

This PR changes the `#fullUpdate` internal method to only take these
properties from `EthKeyringController` stores:
- `vault`
- `keyrings`
- `isUnlocked`
- `encryptionKey`
- `encryptionSalt`

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

<!--
Are there any issues that this pull request is tied to? Are there other
links that reviewers should consult to understand these changes better?

For example:

* Fixes #12345
* Related to #67890
-->

## Changelog

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

### `@metamask/keyring-controller`

- **FIXED**: Removed `keyringTypes` from updated properties from
`EthKeyringController` stores

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
…#1710)

## Explanation
The property `keyringTypes` has been removed from `KeyringController`'s
store, but as `EthKeyringController` still has this property in its
`memStore`, and as in the `KeyringController.#fullUpdate` we destructure
the entire object, we also carry over `keyringTypes` - a property we
don't have metadata for.

This PR changes the `#fullUpdate` internal method to only take these
properties from `EthKeyringController` stores:
- `vault`
- `keyrings`
- `isUnlocked`
- `encryptionKey`
- `encryptionSalt`

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

<!--
Are there any issues that this pull request is tied to? Are there other
links that reviewers should consult to understand these changes better?

For example:

* Fixes #12345
* Related to #67890
-->

## Changelog

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

### `@metamask/keyring-controller`

- **FIXED**: Removed `keyringTypes` from updated properties from
`EthKeyringController` stores

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants