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

fix: BIP39 use given language to generate mnemonics; #852

Conversation

JeneaVranceanu
Copy link
Collaborator

@JeneaVranceanu JeneaVranceanu commented Mar 31, 2024

Summary of Changes

One of the users raised an issue where using a language any but English produces only English BIP39 mnemonics. This PR addresses the issue and adds a test to make sure each language uses the correct words.

Original report: https://discord.com/channels/852230666292559882/855075850771496971/1223929794383839293

Test Data or Screenshots

None.

By submitting this pull request, you are confirming the following:
  • I have reviewed the Contribution Guidelines.
  • I have performed a self-review of my own code.
  • I have updated my repository to match the develop branch.
  • I have included test data or screenshots that prove my fix is effective or that my feature works.
  • I have checked that all tests work and swiftlint is not throwing any errors/warnings.

@JeneaVranceanu
Copy link
Collaborator Author

@yaroslavyaroslav
Copy link
Collaborator

@JeneaVranceanu It's broken because of too new method in the tests /Users/runner/work/web3swift/web3swift/Tests/web3swiftTests/localTests/BIP39Tests.swift:20:51: error: 'split(separator:maxSplits:omittingEmptySubsequences:)' is only available in macOS 13.0 or newer let wordsOfNewMnemonic = newMnemonics.split(separator: language.separator).map { String($0) }

I believe, nothing should go wrong if to mark this given tests with a proper @availabile modifier.

@yaroslavyaroslav yaroslavyaroslav merged commit 58c7d08 into web3swift-team:develop Apr 1, 2024
2 checks passed
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