1
0

kivy: support old-type seed phrases in wizard

This commit is contained in:
ThomasV
2016-03-01 20:23:30 +01:00
parent 384c7cacd7
commit d58ec9a570
3 changed files with 14 additions and 9 deletions

View File

@@ -452,7 +452,13 @@ class RestoreSeedDialog(WizardDialog):
super(RestoreSeedDialog, self).__init__(**kwargs)
self._test = kwargs['test']
from electrum.mnemonic import Mnemonic
self.mnemonic = Mnemonic('en')
from electrum.old_mnemonic import words as old_wordlist
self.words = set(Mnemonic('en').wordlist).union(set(old_wordlist))
def get_suggestions(self, prefix):
for w in self.words:
if w.startswith(prefix):
yield w
def on_text(self, dt):
self.ids.next.disabled = not bool(self._test(self.get_text()))
@@ -467,7 +473,7 @@ class RestoreSeedDialog(WizardDialog):
enable_space = False
self.ids.suggestions.clear_widgets()
suggestions = [x for x in self.mnemonic.get_suggestions(last_word)]
suggestions = [x for x in self.get_suggestions(last_word)]
if suggestions and len(suggestions) < 10:
for w in suggestions:
if w == last_word: