mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-09 15:58:48 +00:00
Fix BIP-85 checksum validation test
This commit is contained in:
@@ -12,10 +12,12 @@ def test_validate_bip85_seed_invalid_word():
|
|||||||
|
|
||||||
def test_validate_bip85_seed_checksum_failure():
|
def test_validate_bip85_seed_checksum_failure():
|
||||||
pm = PasswordManager.__new__(PasswordManager)
|
pm = PasswordManager.__new__(PasswordManager)
|
||||||
m = Mnemonic("english")
|
# Use a known valid phrase to avoid randomness causing a valid checksum
|
||||||
phrase = m.generate(strength=128)
|
phrase = (
|
||||||
|
"legal winner thank year wave sausage worth useful legal winner thank yellow"
|
||||||
|
)
|
||||||
words = phrase.split()
|
words = phrase.split()
|
||||||
words[-1] = "abandon" if words[-1] != "abandon" else "about"
|
words[-1] = "abandon"
|
||||||
bad_phrase = " ".join(words)
|
bad_phrase = " ".join(words)
|
||||||
assert not pm.validate_bip85_seed(bad_phrase)
|
assert not pm.validate_bip85_seed(bad_phrase)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user