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

unable to determine outcome based on API shape: NewSeed should return ([]byte, error). #37

Open
sneak opened this issue Oct 4, 2020 · 1 comment
Milestone

Comments

@sneak
Copy link

sneak commented Oct 4, 2020

  seed := bip39.NewSeed(mnemonic, "Secret Passphrase")

This should return ([]byte, error) and validate the mnemonic. Without reading your library, it's unclear what happens if you pass in a mnemonic that's the wrong number of words, or contains words not on the wordlist, et c.

@tyler-smith
Copy link
Owner

You are right, this is a bad API design. You should explicitly check that the mnemonic is valid with the provided utility functions. In v2 there will be no way to instantiate an invalid mnemonic without an error being presented.

@tyler-smith tyler-smith added this to the 2.0 milestone Oct 27, 2020
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

No branches or pull requests

2 participants