Better install wizard
Break out the workflow logic of the install wizard into a base class. This means reimplementing with full support in a new GUI is now easy; you just provide ways to request passwords, show messages etc. The API is fully documented in the base class. There are a couple of minor outstanding issues, including that the old messages shown when recovering a wallet are missing. I will come back to that. Ledger wallet might be broken. Other improvements: The install wizard code is now easy to follow and understand. Hardware wallets can now be restored without any need for their accompanying libraries. Various bits of trustedcoin were broken and have been fixed. Many plugin hooks can be removed. I have only started on this.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from keepkey import KeepKeyPlugin
|
||||
from electrum.util import print_msg
|
||||
from electrum.plugins import hook
|
||||
|
||||
class KeepKeyCmdLineHandler:
|
||||
|
||||
@@ -23,8 +22,4 @@ class KeepKeyCmdLineHandler:
|
||||
print_msg(msg)
|
||||
|
||||
class Plugin(KeepKeyPlugin):
|
||||
@hook
|
||||
def cmdline_load_wallet(self, wallet):
|
||||
wallet.plugin = self
|
||||
if self.handler is None:
|
||||
self.handler = KeepKeyCmdLineHandler()
|
||||
handler = KeepKeyCmdLineHandler()
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
from plugins.trezor.client import trezor_client_class
|
||||
from plugins.trezor.plugin import TrezorCompatiblePlugin, TrezorCompatibleWallet
|
||||
|
||||
try:
|
||||
from keepkeylib.client import proto, BaseClient, ProtocolMixin
|
||||
KEEPKEY = True
|
||||
except ImportError:
|
||||
KEEPKEY = False
|
||||
|
||||
|
||||
class KeepKeyWallet(TrezorCompatibleWallet):
|
||||
wallet_type = 'keepkey'
|
||||
@@ -14,12 +8,16 @@ class KeepKeyWallet(TrezorCompatibleWallet):
|
||||
|
||||
|
||||
class KeepKeyPlugin(TrezorCompatiblePlugin):
|
||||
client_class = trezor_client_class(ProtocolMixin, BaseClient, proto)
|
||||
firmware_URL = 'https://www.keepkey.com'
|
||||
libraries_URL = 'https://github.com/keepkey/python-keepkey'
|
||||
libraries_available = KEEPKEY
|
||||
minimum_firmware = (1, 0, 0)
|
||||
wallet_class = KeepKeyWallet
|
||||
import keepkeylib.ckd_public as ckd_public
|
||||
from keepkeylib.client import types
|
||||
from keepkeylib.transport_hid import HidTransport
|
||||
try:
|
||||
from keepkeylib.client import proto, BaseClient, ProtocolMixin
|
||||
client_class = trezor_client_class(ProtocolMixin, BaseClient, proto)
|
||||
import keepkeylib.ckd_public as ckd_public
|
||||
from keepkeylib.client import types
|
||||
from keepkeylib.transport_hid import HidTransport
|
||||
libraries_available = True
|
||||
except:
|
||||
libraries_available = False
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
from plugins.trezor.qt_generic import QtPlugin
|
||||
from keepkeylib.qt.pinmatrix import PinMatrixWidget
|
||||
|
||||
|
||||
class Plugin(QtPlugin):
|
||||
pin_matrix_widget_class = PinMatrixWidget
|
||||
icon_file = ":icons/keepkey.png"
|
||||
|
||||
def pin_matrix_widget_class():
|
||||
from keepkeylib.qt.pinmatrix import PinMatrixWidget
|
||||
return PinMatrixWidget
|
||||
|
||||
Reference in New Issue
Block a user