Ledger: get new wallet creation working again
This is enough to get new wallet creation working in the absence of errors.
This commit is contained in:
parent
45f518e191
commit
1ec3ad59cc
|
@ -187,6 +187,9 @@ class BasePlugin(PrintError):
|
||||||
def diagnostic_name(self):
|
def diagnostic_name(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
# remove self from hooks
|
# remove self from hooks
|
||||||
for k in dir(self):
|
for k in dir(self):
|
||||||
|
|
|
@ -53,6 +53,9 @@ class BTChipWallet(BIP44_Wallet):
|
||||||
self.device_checked = False
|
self.device_checked = False
|
||||||
raise Exception(message)
|
raise Exception(message)
|
||||||
|
|
||||||
|
def get_action(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def can_create_accounts(self):
|
def can_create_accounts(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -140,12 +143,14 @@ class BTChipWallet(BIP44_Wallet):
|
||||||
return self.client
|
return self.client
|
||||||
|
|
||||||
def derive_xkeys(self, root, derivation, password):
|
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)
|
xpub = self.get_public_key(derivation)
|
||||||
return xpub, None
|
return xpub, None
|
||||||
|
|
||||||
def get_public_key(self, bip32_path):
|
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
|
# This only happens once so it's bearable
|
||||||
self.get_client() # prompt for the PIN before displaying the dialog if necessary
|
self.get_client() # prompt for the PIN before displaying the dialog if necessary
|
||||||
self.plugin.handler.show_message("Computing master public key")
|
self.plugin.handler.show_message("Computing master public key")
|
||||||
|
|
|
@ -23,8 +23,10 @@ class Plugin(LedgerPlugin):
|
||||||
wallet.force_watching_only = True
|
wallet.force_watching_only = True
|
||||||
|
|
||||||
def on_create_wallet(self, wallet, wizard):
|
def on_create_wallet(self, wallet, wizard):
|
||||||
|
assert type(wallet) == self.wallet_class
|
||||||
self.handler = BTChipQTHandler(wizard)
|
self.handler = BTChipQTHandler(wizard)
|
||||||
wallet.create_main_account()
|
# self.select_device(wallet)
|
||||||
|
wallet.create_hd_account(None)
|
||||||
|
|
||||||
class BTChipQTHandler:
|
class BTChipQTHandler:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue