mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
fix #4698
This commit is contained in:
parent
8caab35d90
commit
f9a5f2e183
7 changed files with 23 additions and 3 deletions
|
@ -7,6 +7,7 @@ from electrum.gui.qt.util import *
|
|||
|
||||
from .coldcard import ColdcardPlugin
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from ..hw_wallet.plugin import only_hook_if_libraries_available
|
||||
|
||||
|
||||
class Plugin(ColdcardPlugin, QtPluginBase):
|
||||
|
@ -17,6 +18,7 @@ class Plugin(ColdcardPlugin, QtPluginBase):
|
|||
return Coldcard_Handler(window)
|
||||
|
||||
@hook
|
||||
@only_hook_if_libraries_available
|
||||
def receive_menu(self, menu, addrs, wallet):
|
||||
if type(wallet) is not Standard_Wallet:
|
||||
return
|
||||
|
@ -27,6 +29,7 @@ class Plugin(ColdcardPlugin, QtPluginBase):
|
|||
menu.addAction(_("Show on Coldcard"), show_address)
|
||||
|
||||
@hook
|
||||
@only_hook_if_libraries_available
|
||||
def transaction_dialog(self, dia):
|
||||
# see gui/qt/transaction_dialog.py
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
from functools import partial
|
||||
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from .digitalbitbox import DigitalBitboxPlugin
|
||||
|
||||
from electrum.i18n import _
|
||||
from electrum.plugin import hook
|
||||
from electrum.wallet import Standard_Wallet
|
||||
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from ..hw_wallet.plugin import only_hook_if_libraries_available
|
||||
from .digitalbitbox import DigitalBitboxPlugin
|
||||
|
||||
|
||||
class Plugin(DigitalBitboxPlugin, QtPluginBase):
|
||||
icon_unpaired = ":icons/digitalbitbox_unpaired.png"
|
||||
|
@ -16,6 +17,7 @@ class Plugin(DigitalBitboxPlugin, QtPluginBase):
|
|||
return DigitalBitbox_Handler(window)
|
||||
|
||||
@hook
|
||||
@only_hook_if_libraries_available
|
||||
def receive_menu(self, menu, addrs, wallet):
|
||||
if type(wallet) is not Standard_Wallet:
|
||||
return
|
||||
|
|
|
@ -135,3 +135,10 @@ def trezor_validate_op_return_output_and_get_data(output: TxOutput) -> bytes:
|
|||
if output.value != 0:
|
||||
raise Exception(_("Amount for OP_RETURN output must be zero."))
|
||||
return script[2:]
|
||||
|
||||
|
||||
def only_hook_if_libraries_available(func):
|
||||
def wrapper(self, *args, **kwargs):
|
||||
if not self.libraries_available: return None
|
||||
return func(self, *args, **kwargs)
|
||||
return wrapper
|
||||
|
|
|
@ -12,6 +12,7 @@ from electrum.util import PrintError, UserCancelled, bh2u
|
|||
from electrum.wallet import Wallet, Standard_Wallet
|
||||
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from ..hw_wallet.plugin import only_hook_if_libraries_available
|
||||
from .keepkey import KeepKeyPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
|
||||
|
||||
|
||||
|
@ -195,6 +196,7 @@ class QtPlugin(QtPluginBase):
|
|||
return QtHandler(window, self.pin_matrix_widget_class(), self.device)
|
||||
|
||||
@hook
|
||||
@only_hook_if_libraries_available
|
||||
def receive_menu(self, menu, addrs, wallet):
|
||||
if type(wallet) is not Standard_Wallet:
|
||||
return
|
||||
|
|
|
@ -7,6 +7,7 @@ from electrum.gui.qt.util import *
|
|||
|
||||
from .ledger import LedgerPlugin
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from ..hw_wallet.plugin import only_hook_if_libraries_available
|
||||
|
||||
|
||||
class Plugin(LedgerPlugin, QtPluginBase):
|
||||
|
@ -17,6 +18,7 @@ class Plugin(LedgerPlugin, QtPluginBase):
|
|||
return Ledger_Handler(window)
|
||||
|
||||
@hook
|
||||
@only_hook_if_libraries_available
|
||||
def receive_menu(self, menu, addrs, wallet):
|
||||
if type(wallet) is not Standard_Wallet:
|
||||
return
|
||||
|
|
|
@ -12,6 +12,7 @@ from electrum.util import PrintError, UserCancelled, bh2u
|
|||
from electrum.wallet import Wallet, Standard_Wallet
|
||||
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from ..hw_wallet.plugin import only_hook_if_libraries_available
|
||||
from .safe_t import SafeTPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
|
||||
|
||||
|
||||
|
@ -71,6 +72,7 @@ class QtPlugin(QtPluginBase):
|
|||
return QtHandler(window, self.pin_matrix_widget_class(), self.device)
|
||||
|
||||
@hook
|
||||
@only_hook_if_libraries_available
|
||||
def receive_menu(self, menu, addrs, wallet):
|
||||
if len(addrs) != 1:
|
||||
return
|
||||
|
|
|
@ -12,6 +12,7 @@ from electrum.util import PrintError, UserCancelled, bh2u
|
|||
from electrum.wallet import Wallet, Standard_Wallet
|
||||
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from ..hw_wallet.plugin import only_hook_if_libraries_available
|
||||
from .trezor import (TrezorPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC,
|
||||
RECOVERY_TYPE_SCRAMBLED_WORDS, RECOVERY_TYPE_MATRIX)
|
||||
|
||||
|
@ -166,6 +167,7 @@ class QtPlugin(QtPluginBase):
|
|||
return QtHandler(window, self.pin_matrix_widget_class(), self.device)
|
||||
|
||||
@hook
|
||||
@only_hook_if_libraries_available
|
||||
def receive_menu(self, menu, addrs, wallet):
|
||||
if len(addrs) != 1:
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue