Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyringController.verifySeedPhrase should return a Uint8Array #1338

Merged
merged 4 commits into from
May 8, 2023

Conversation

mikesposito
Copy link
Member

@mikesposito mikesposito commented May 8, 2023

Description

This PR changes the value returned by verifySeedPhrase. Currently the method return type is shown as string, but actually what we used to take from HD keyring and return was not an actual string, but an array of an encoded string taken from HDKeyring.mnemonic, using serialize().

As we now want to handle the seedphrase as Uint8Array, we can call directly HDKeyring.mnemonic as it is in the right type already, skipping a useless double conversion.

Changes

  • BREAKING: Change verifySeedPhrase return type from string to Uint8Array

References

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

@mikesposito mikesposito force-pushed the refactor/1246-seed-phrase-as-uint8array branch from c415b7d to 8381201 Compare May 8, 2023 09:02
@mikesposito mikesposito marked this pull request as ready for review May 8, 2023 09:03
@mikesposito mikesposito requested a review from a team as a code owner May 8, 2023 09:03
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! I updated the PR description change entry as well, to include what the return type was before and after.

@mikesposito mikesposito merged commit fef20fc into main May 8, 2023
@mikesposito mikesposito deleted the refactor/1246-seed-phrase-as-uint8array branch May 8, 2023 14:46
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* refactor: verifySeedPhrase should return a Uint8Array

* refactor: verifySeedPhrase should return a Uint8Array

* docs: update jsdoc
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* refactor: verifySeedPhrase should return a Uint8Array

* refactor: verifySeedPhrase should return a Uint8Array

* docs: update jsdoc
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.

KeyringController: verifySeedPhrase should handle seed phrase as Uint8Array
2 participants