Skip to content

Commit

Permalink
Merge pull request ethereum#254 from ethereum/fix_abbreviated_test
Browse files Browse the repository at this point in the history
Actually shortens words for abbrviated mnemonic test vectors
  • Loading branch information
hwwhww authored Mar 29, 2022
2 parents 8498db1 + 4f0811a commit c06b990
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_key_handling/test_key_derivation/test_mnemonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
from typing import (
Sequence,
)
from unicodedata import normalize

from staking_deposit.utils.constants import (
MNEMONIC_LANG_OPTIONS,
)
from staking_deposit.key_handling.key_derivation.mnemonic import (
_index_to_word,
_get_word_list,
abbreviate_words,
get_seed,
get_mnemonic,
reconstruct_mnemonic,
Expand Down Expand Up @@ -52,7 +52,8 @@ def test_reconstruct_mnemonic(test_mnemonic: str) -> None:

def abbreviate_mnemonic(mnemonic: str) -> str:
words = str.split(mnemonic)
words = [normalize('NFKC', word) for word in words]
words = abbreviate_words(words)
assert all([len(word) <= 4 for word in words])
return str.join(' ', words)


Expand Down

0 comments on commit c06b990

Please sign in to comment.