diff --git a/lib/plugins.py b/lib/plugins.py index 9cf90cf2..199e2f12 100644 --- a/lib/plugins.py +++ b/lib/plugins.py @@ -187,6 +187,9 @@ class BasePlugin(PrintError): def diagnostic_name(self): return self.name + def __str__(self): + return self.name + def close(self): # remove self from hooks for k in dir(self): diff --git a/plugins/ledger/ledger.py b/plugins/ledger/ledger.py index 8e5e5474..55c97575 100644 --- a/plugins/ledger/ledger.py +++ b/plugins/ledger/ledger.py @@ -53,6 +53,9 @@ class BTChipWallet(BIP44_Wallet): self.device_checked = False raise Exception(message) + def get_action(self): + pass + def can_create_accounts(self): return False @@ -140,12 +143,14 @@ class BTChipWallet(BIP44_Wallet): return self.client def derive_xkeys(self, root, derivation, password): - derivation = derivation.replace(self.root_name,"44'/0'/") + derivation = '/'.join(derivation.split('/')[1:]) xpub = self.get_public_key(derivation) return xpub, None def get_public_key(self, bip32_path): - # S-L-O-W - we don't handle the fingerprint directly, so compute it manually from the previous node + # bip32_path is of the form 44'/0'/1' + # S-L-O-W - we don't handle the fingerprint directly, so compute + # it manually from the previous node # This only happens once so it's bearable self.get_client() # prompt for the PIN before displaying the dialog if necessary self.plugin.handler.show_message("Computing master public key") diff --git a/plugins/ledger/qt.py b/plugins/ledger/qt.py index 60167131..f29fbde1 100644 --- a/plugins/ledger/qt.py +++ b/plugins/ledger/qt.py @@ -23,8 +23,10 @@ class Plugin(LedgerPlugin): wallet.force_watching_only = True def on_create_wallet(self, wallet, wizard): + assert type(wallet) == self.wallet_class self.handler = BTChipQTHandler(wizard) - wallet.create_main_account() +# self.select_device(wallet) + wallet.create_hd_account(None) class BTChipQTHandler: