1
0

coldcard: wallet info dlg: fix missing "Export for Coldcard" btn

regression from 711a325085

```
 47.97 | E | plugin | Plugin error. plugin: coldcard, hook: wallet_info_buttons
Traceback (most recent call last):
  File "...\electrum\electrum\plugin.py", line 261, in run_hook
    r = f(*args)
  File "...\electrum\electrum\plugins\hw_wallet\plugin.py", line 344, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\plugins\coldcard\qt.py", line 51, in wallet_info_buttons
    wallet = main_window.wallet
AttributeError: 'WalletInfoDialog' object has no attribute 'wallet'
```
This commit is contained in:
SomberNight
2024-02-13 13:35:19 +00:00
parent 66af6e6239
commit 7cf22d4b9f
2 changed files with 3 additions and 2 deletions

View File

@@ -161,7 +161,7 @@ class WalletInfoDialog(WindowModalDialog):
vbox.addWidget(ks_stack)
vbox.addStretch(1)
btn_export_info = run_hook('wallet_info_buttons', self, self)
btn_export_info = run_hook('wallet_info_buttons', window, self)
btn_close = CloseButton(self)
btns = Buttons(btn_export_info, btn_close)
vbox.addLayout(btns)

View File

@@ -45,9 +45,10 @@ class Plugin(ColdcardPlugin, QtPluginBase):
@only_hook_if_libraries_available
@hook
def wallet_info_buttons(self, main_window, dialog):
def wallet_info_buttons(self, main_window: 'ElectrumWindow', dialog):
# user is about to see the "Wallet Information" dialog
# - add a button if multisig wallet, and a Coldcard is a cosigner.
assert isinstance(main_window, ElectrumWindow), f"{type(main_window)}"
wallet = main_window.wallet
if type(wallet) is not Multisig_Wallet: