Closed husio closed 5 years ago
IsMnemonicValid returns true for invalid mnemonic sequences that do not pass the checsum test. Take any valid mnemonic and change one of the words. IsMnemonicValid must return false for that input.
IsMnemonicValid
true
false
go-bip39 $ go test . --- FAIL: TestIsMnemonicValid (0.00s) bip39_test.go:450: Expected false, got true FAIL FAIL _/home/piotr/go-bip39 0.232s go-bip39 $ git diff diff --git a/bip39_test.go b/bip39_test.go index 230c831..63d19e0 100644 --- a/bip39_test.go +++ b/bip39_test.go @@ -408,6 +408,7 @@ func testVectors() []vector { func badMnemonicSentences() []vector { return []vector{ + {mnemonic: "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon letter"}, {mnemonic: "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon"}, {mnemonic: "legal winner thank year wave sausage worth useful legal winner thank yellow yellow"}, {mnemonic: "letter advice cage absurd amount doctor acoustic avoid letter advice caged above"},
Thank you for the report. Fixed in PR #33.
IsMnemonicValid
returnstrue
for invalid mnemonic sequences that do not pass the checsum test. Take any valid mnemonic and change one of the words.IsMnemonicValid
must returnfalse
for that input.