follow-up prev commit: revert "strict checks" for old seeds
This commit is contained in:
parent
d45e13553a
commit
c05549c8cd
|
@ -264,10 +264,9 @@ def is_old_seed(seed):
|
|||
seed = mnemonic.normalize_text(seed)
|
||||
words = seed.split()
|
||||
try:
|
||||
hex_seed = old_mnemonic.mn_decode(words)
|
||||
words2 = old_mnemonic.mn_encode(hex_seed)
|
||||
seed2 = ' '.join(words2)
|
||||
uses_electrum_words = seed == seed2
|
||||
# checks here are deliberately left weak for legacy reasons, see #3149
|
||||
old_mnemonic.mn_decode(words)
|
||||
uses_electrum_words = True
|
||||
except Exception:
|
||||
uses_electrum_words = False
|
||||
try:
|
||||
|
|
|
@ -355,7 +355,8 @@ class Test_seeds(unittest.TestCase):
|
|||
('cell dumb heartbeat north boom tease ship baby bright kingdom rare badword', ''),
|
||||
('cElL DuMb hEaRtBeAt nOrTh bOoM TeAsE ShIp bAbY BrIgHt kInGdOm rArE SqUeEzE', 'old'),
|
||||
(' cElL DuMb hEaRtBeAt nOrTh bOoM TeAsE ShIp bAbY BrIgHt kInGdOm rArE SqUeEzE ', 'old'),
|
||||
('hurry idiot prefer sunset mention mist jaw inhale impossible kingdom rare squeeze', ''), # almost 'old' but maps to 33 hex chars
|
||||
# below seed is actually 'invalid old' as it maps to 33 hex chars
|
||||
('hurry idiot prefer sunset mention mist jaw inhale impossible kingdom rare squeeze', 'old'),
|
||||
('cram swing cover prefer miss modify ritual silly deliver chunk behind inform able', 'standard'),
|
||||
('cram swing cover prefer miss modify ritual silly deliver chunk behind inform', ''),
|
||||
('ostrich security deer aunt climb inner alpha arm mutual marble solid task', 'standard'),
|
||||
|
|
Loading…
Reference in New Issue