1
0

hardware wallets: create base class for HW Clients. add some type hints

This commit is contained in:
SomberNight
2019-11-11 17:04:12 +01:00
parent 2fec17760d
commit f8c84fbb1e
10 changed files with 75 additions and 50 deletions

View File

@@ -7,6 +7,7 @@ from electrum.util import UserCancelled
from electrum.keystore import bip39_normalize_passphrase
from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32
from electrum.logging import Logger
from electrum.plugins.hw_wallet.plugin import HardwareClientBase
class GuiMixin(object):
@@ -94,7 +95,7 @@ class GuiMixin(object):
return self.proto.CharacterAck(**char_info)
class KeepKeyClientBase(GuiMixin, Logger):
class KeepKeyClientBase(HardwareClientBase, GuiMixin, Logger):
def __init__(self, handler, plugin, proto):
assert hasattr(self, 'tx_api') # ProtocolMixin already constructed?
@@ -112,11 +113,9 @@ class KeepKeyClientBase(GuiMixin, Logger):
return "%s/%s" % (self.label(), self.features.device_id)
def label(self):
'''The name given by the user to the device.'''
return self.features.label
def is_initialized(self):
'''True if initialized, False if wiped.'''
return self.features.initialized
def is_pairable(self):