From 3be3723a243b8aed20b13c2303dc87c4a61f3244 Mon Sep 17 00:00:00 2001 From: Carl Beekhuizen Date: Tue, 29 Mar 2022 15:03:24 +0200 Subject: [PATCH] Actually shortens words for abbrviated mnemonic test vectors --- tests/test_key_handling/test_key_derivation/test_mnemonic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_key_handling/test_key_derivation/test_mnemonic.py b/tests/test_key_handling/test_key_derivation/test_mnemonic.py index 03aaf8b0..9d1ae9d0 100644 --- a/tests/test_key_handling/test_key_derivation/test_mnemonic.py +++ b/tests/test_key_handling/test_key_derivation/test_mnemonic.py @@ -4,7 +4,6 @@ from typing import ( Sequence, ) -from unicodedata import normalize from staking_deposit.utils.constants import ( MNEMONIC_LANG_OPTIONS, @@ -12,6 +11,7 @@ from staking_deposit.key_handling.key_derivation.mnemonic import ( _index_to_word, _get_word_list, + abbreviate_words, get_seed, get_mnemonic, reconstruct_mnemonic, @@ -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)