1
0

qml wizard: "confirm seed" screen to normalize whitespaces

fixes https://github.com/spesmilo/electrum/issues/8442
This commit is contained in:
SomberNight
2023-05-17 15:19:41 +00:00
parent fd41308c6b
commit e9475345e4
5 changed files with 43 additions and 3 deletions

View File

@@ -90,6 +90,16 @@ def normalize_text(seed: str) -> str:
return seed
def is_matching_seed(*, seed: str, seed_again: str) -> bool:
"""Compare two seeds for equality, as used in "confirm seed" screen in wizard.
Not just for electrum seeds, but other types (e.g. bip39) as well.
Note: we don't use normalize_text, as that is specific to electrum seeds.
"""
seed = " ".join(seed.split())
seed_again = " ".join(seed_again.split())
return seed == seed_again
_WORDLIST_CACHE = {} # type: Dict[str, Wordlist]