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

Restore compatibility with QR Keyring #252

Merged
merged 1 commit into from
Jul 18, 2023
Merged

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Jul 18, 2023

Description

The KeyringController method addNewKeyring was changed in v11 to initialize the keyring options to an empty object. These options are passed to the deserialize method of the keyring. This broke compatibility with the QR keyring because its deserialize method does not expect to be passed an empty object.

The KeyringController has been updated to no longer initialize the addNewKeyring options to an empty object. It should now work the same as it did prior to v11. The one functional difference is that it now throws an error when addNewKeyring is used to add a simple keyring without supplying any private keys, however that path would have already thrown an error.

Changes

  • Fixed: Fix addNewKeyring incompatbility when no options are provided
    • The addNewKeyring method stopped working with certain keyrings (e.g. the QR keyring) in v11 when called with no options.

References

This bug was introduced before and fixed in the past, e.g. #136

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation for new or updated code as appropriate (note: this will usually be JSDoc)
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@Gudahtt

This comment was marked as resolved.

Base automatically changed from refactor-tests to main July 18, 2023 12:08
The `KeyringController` method `addNewKeyring` was changed in v11 to
initialize the keyring options to an empty object. These options are
passed to the `deserialize` method of the keyring. This broke
compatibility with the QR keyring because its `deserialize` method does
not expect to be passed an empty object.

The `KeyringController` has been updated to no longer initialize the
`addNewKeyring` options to an empty object. It should now work the same
as it did prior to v11. The one functional difference is that it now
throws an error when `addNewKeyring` is used to add a simple keyring
without supplying any private keys, however that path would have
already thrown an error.
@Gudahtt Gudahtt force-pushed the fix-qr-keyring-compatibility branch from 9ebdc0f to 836b5a4 Compare July 18, 2023 12:09
@Gudahtt Gudahtt marked this pull request as ready for review July 18, 2023 12:09
@Gudahtt Gudahtt requested a review from a team as a code owner July 18, 2023 12:09
Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

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

LGTM!

@Gudahtt Gudahtt merged commit 1941d3c into main Jul 18, 2023
@Gudahtt Gudahtt deleted the fix-qr-keyring-compatibility branch July 18, 2023 12:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants