1
0

Modify Ledger plugin to support the new bitcoin app v2.1.0

This commit is contained in:
Salvatore Ingala
2022-10-18 15:29:03 +02:00
parent acde8cd0b7
commit 2d64dc13c9
4 changed files with 910 additions and 234 deletions

View File

@@ -6,7 +6,8 @@ hidapi<0.11
trezor[hidapi]>=0.13.0,<0.14 trezor[hidapi]>=0.13.0,<0.14
safet>=0.1.5 safet>=0.1.5
keepkey>=6.3.1 keepkey>=6.3.1
btchip-python>=0.1.32 btchip-python>=0.1.32 # used for legacy Ledger Bitcoin app up to versions 2.0.* or below
ledger-bitcoin=0.1.1 # used for new Ledger Bitcoin app >= v2.1.0 and above
ckcc-protocol>=0.7.7 ckcc-protocol>=0.7.7
bitbox02>=6.0.0 bitbox02>=6.0.0
cbor>=1.0.0,<2.0.0 cbor>=1.0.0,<2.0.0

View File

@@ -2,6 +2,6 @@ from electrum.i18n import _
fullname = 'Ledger Wallet' fullname = 'Ledger Wallet'
description = 'Provides support for Ledger hardware wallet' description = 'Provides support for Ledger hardware wallet'
requires = [('btchip', 'github.com/ledgerhq/btchip-python')] requires = [('btchip', 'github.com/ledgerhq/btchip-python'), ('ledger_bitcoin', 'github.com/LedgerHQ/app-bitcoin-new')]
registers_keystore = ('hardware', 'ledger', _("Ledger wallet")) registers_keystore = ('hardware', 'ledger', _("Ledger wallet"))
available_for = ['qt', 'cmdline'] available_for = ['qt', 'cmdline']

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@ class Plugin(LedgerPlugin, QtPluginBase):
keystore = wallet.get_keystore() keystore = wallet.get_keystore()
if type(keystore) == self.keystore_class and len(addrs) == 1: if type(keystore) == self.keystore_class and len(addrs) == 1:
def show_address(): def show_address():
keystore.thread.add(partial(self.show_address, wallet, addrs[0])) keystore.thread.add(partial(self.show_address, wallet, addrs[0], keystore=keystore))
menu.addAction(_("Show on Ledger"), show_address) menu.addAction(_("Show on Ledger"), show_address)
class Ledger_Handler(QtHandlerBase): class Ledger_Handler(QtHandlerBase):