1
0

support TrustedCoin plugin in the kivy GUI

This commit is contained in:
ThomasV
2018-05-18 18:07:52 +02:00
parent 5a75ce74d7
commit 8d5e666d30
10 changed files with 291 additions and 92 deletions

View File

@@ -48,9 +48,10 @@ class GoBack(Exception): pass
class BaseWizard(object):
def __init__(self, config, storage):
def __init__(self, config, plugins, storage):
super(BaseWizard, self).__init__()
self.config = config
self.plugins = plugins
self.storage = storage
self.wallet = None
self.stack = []
@@ -59,6 +60,9 @@ class BaseWizard(object):
self.is_kivy = config.get('gui') == 'kivy'
self.seed_type = None
def set_icon(self, icon):
pass
def run(self, *args):
action = args[0]
args = args[1:]
@@ -369,12 +373,8 @@ class BaseWizard(object):
elif self.seed_type == 'old':
self.run('create_keystore', seed, '')
elif self.seed_type == '2fa':
if self.is_kivy:
self.show_error(_('2FA seeds are not supported in this version'))
self.run('restore_from_seed')
else:
self.load_2fa()
self.run('on_restore_seed', seed, is_ext)
self.load_2fa()
self.run('on_restore_seed', seed, is_ext)
else:
raise Exception('Unknown seed type', self.seed_type)

View File

@@ -446,6 +446,10 @@ def user_dir():
#raise Exception("No home directory found in environment variables.")
return
def is_valid_email(s):
regexp = r"[^@]+@[^@]+\.[^@]+"
return re.match(regexp, s) is not None
def format_satoshis_plain(x, decimal_point = 8):
"""Display a satoshi amount scaled. Always uses a '.' as a decimal

View File

@@ -1513,6 +1513,7 @@ class Abstract_Wallet(PrintError):
k.sign_transaction(tx, password)
except UserCancelled:
continue
return tx
def get_unused_addresses(self):
# fixme: use slots from expired requests