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:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user