move hw_wallet.py from plugins to electrum library
This commit is contained in:
@@ -51,7 +51,7 @@ from .logging import get_logger, Logger
|
||||
from .crypto import sha256
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .plugins.hw_wallet import HW_PluginBase, HardwareClientBase, HardwareHandlerBase
|
||||
from .hw_wallet import HW_PluginBase, HardwareClientBase, HardwareHandlerBase
|
||||
from .keystore import Hardware_KeyStore, KeyStore
|
||||
from .wallet import Abstract_Wallet
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ from electrum.bitcoin import OnchainOutputType
|
||||
|
||||
import electrum.bitcoin as bitcoin
|
||||
|
||||
from ..hw_wallet import HW_PluginBase, HardwareClientBase, HardwareHandlerBase
|
||||
from electrum.hw_wallet import HW_PluginBase, HardwareClientBase, HardwareHandlerBase
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from electrum.wizard import NewWalletWizard
|
||||
|
||||
@@ -10,8 +10,8 @@ from electrum.plugin import hook
|
||||
from electrum.util import UserCancelled, UserFacingException
|
||||
|
||||
from .bitbox02 import BitBox02Plugin
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from ..hw_wallet.plugin import only_hook_if_libraries_available, OperationCancelled
|
||||
from electrum.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.hw_wallet.plugin import only_hook_if_libraries_available, OperationCancelled
|
||||
|
||||
from electrum.gui.qt.wizard.wallet import WCScriptAndDerivation, WCHWUnlock, WCHWUninitialized, WCHWXPub
|
||||
from electrum.gui.qt.util import WindowModalDialog, OkButton, ButtonsTextEdit
|
||||
|
||||
@@ -2,7 +2,7 @@ from electrum.plugin import hook
|
||||
from electrum.util import print_msg, raw_input, print_stderr
|
||||
from electrum.logging import get_logger
|
||||
|
||||
from ..hw_wallet.cmdline import CmdLineHandler
|
||||
from electrum.hw_wallet.cmdline import CmdLineHandler
|
||||
|
||||
from .coldcard import ColdcardPlugin
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ from electrum.wallet import Standard_Wallet, Multisig_Wallet, Abstract_Wallet
|
||||
from electrum.util import bfh, versiontuple, UserFacingException
|
||||
from electrum.logging import get_logger
|
||||
|
||||
from ..hw_wallet import HW_PluginBase, HardwareClientBase
|
||||
from ..hw_wallet.plugin import LibraryFoundButUnusable, only_hook_if_libraries_available
|
||||
from electrum.hw_wallet import HW_PluginBase, HardwareClientBase
|
||||
from electrum.hw_wallet.plugin import LibraryFoundButUnusable, only_hook_if_libraries_available
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from electrum.plugin import DeviceInfo
|
||||
|
||||
@@ -12,8 +12,8 @@ from electrum.plugin import hook
|
||||
from electrum.wallet import Multisig_Wallet
|
||||
|
||||
from .coldcard import ColdcardPlugin, xfp2str
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from ..hw_wallet.plugin import only_hook_if_libraries_available
|
||||
from electrum.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.hw_wallet.plugin import only_hook_if_libraries_available
|
||||
from electrum.gui.qt.wizard.wallet import WCScriptAndDerivation, WCHWXPub, WCHWUninitialized, WCHWUnlock
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from electrum.plugin import hook
|
||||
from .digitalbitbox import DigitalBitboxPlugin
|
||||
from ..hw_wallet import CmdLineHandler
|
||||
from electrum.hw_wallet import CmdLineHandler
|
||||
|
||||
class Plugin(DigitalBitboxPlugin):
|
||||
handler = CmdLineHandler()
|
||||
|
||||
@@ -34,8 +34,8 @@ from electrum.network import Network
|
||||
from electrum.logging import get_logger
|
||||
from electrum.plugin import runs_in_hwd_thread, run_in_hwd_thread
|
||||
|
||||
from ..hw_wallet import HW_PluginBase, HardwareClientBase, HardwareHandlerBase
|
||||
from ..hw_wallet.plugin import OperationCancelled
|
||||
from electrum.hw_wallet import HW_PluginBase, HardwareClientBase, HardwareHandlerBase
|
||||
from electrum.hw_wallet.plugin import OperationCancelled
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from electrum.plugin import DeviceInfo
|
||||
|
||||
@@ -9,8 +9,8 @@ from electrum.plugin import hook
|
||||
from electrum.wallet import Standard_Wallet, Abstract_Wallet
|
||||
from electrum.util import UserCancelled, UserFacingException
|
||||
|
||||
from electrum.plugins.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.plugins.hw_wallet.plugin import only_hook_if_libraries_available, OperationCancelled
|
||||
from electrum.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.hw_wallet.plugin import only_hook_if_libraries_available, OperationCancelled
|
||||
|
||||
from electrum.gui.qt.wizard.wallet import WCScriptAndDerivation, WCHWXPub, WCHWUnlock
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from electrum.plugin import hook
|
||||
from .jade import JadePlugin
|
||||
from ..hw_wallet import CmdLineHandler
|
||||
from electrum.hw_wallet import CmdLineHandler
|
||||
|
||||
class Plugin(JadePlugin):
|
||||
handler = CmdLineHandler()
|
||||
|
||||
@@ -14,8 +14,8 @@ from electrum.logging import get_logger
|
||||
from electrum.plugin import runs_in_hwd_thread, Device
|
||||
from electrum.network import Network
|
||||
|
||||
from electrum.plugins.hw_wallet import HW_PluginBase, HardwareClientBase
|
||||
from electrum.plugins.hw_wallet.plugin import OutdatedHwFirmwareException
|
||||
from electrum.hw_wallet import HW_PluginBase, HardwareClientBase
|
||||
from electrum.hw_wallet.plugin import OutdatedHwFirmwareException
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from electrum.plugin import DeviceInfo
|
||||
|
||||
@@ -7,8 +7,8 @@ from electrum.i18n import _
|
||||
from electrum.plugin import hook
|
||||
from electrum.wallet import Standard_Wallet
|
||||
|
||||
from electrum.plugins.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.plugins.hw_wallet import plugin
|
||||
from electrum.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.hw_wallet import plugin
|
||||
from electrum.gui.qt.wizard.wallet import WCScriptAndDerivation, WCHWUnlock, WCHWXPub, WCHWUninitialized
|
||||
|
||||
from .jade import JadePlugin
|
||||
|
||||
@@ -10,7 +10,7 @@ from electrum.keystore import bip39_normalize_passphrase
|
||||
from electrum.bip32 import BIP32Node, convert_bip32_strpath_to_intpath
|
||||
from electrum.logging import Logger
|
||||
from electrum.plugin import runs_in_hwd_thread
|
||||
from electrum.plugins.hw_wallet.plugin import HardwareClientBase, HardwareHandlerBase
|
||||
from electrum.hw_wallet.plugin import HardwareClientBase, HardwareHandlerBase
|
||||
|
||||
|
||||
class GuiMixin(object):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from electrum.plugin import hook
|
||||
from electrum.hw_wallet import CmdLineHandler
|
||||
from .keepkey import KeepKeyPlugin
|
||||
from ..hw_wallet import CmdLineHandler
|
||||
|
||||
class Plugin(KeepKeyPlugin):
|
||||
handler = CmdLineHandler()
|
||||
|
||||
@@ -9,8 +9,8 @@ from electrum.transaction import Transaction, PartialTransaction, PartialTxInput
|
||||
from electrum.keystore import Hardware_KeyStore
|
||||
from electrum.plugin import Device, runs_in_hwd_thread
|
||||
|
||||
from ..hw_wallet import HW_PluginBase
|
||||
from ..hw_wallet.plugin import is_any_tx_output_on_change_branch, trezor_validate_op_return_output_and_get_data
|
||||
from electrum.hw_wallet import HW_PluginBase
|
||||
from electrum.hw_wallet.plugin import is_any_tx_output_on_change_branch, trezor_validate_op_return_output_and_get_data
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import usb1
|
||||
|
||||
@@ -15,9 +15,9 @@ from electrum.i18n import _
|
||||
from electrum.plugin import hook
|
||||
from electrum.logging import Logger
|
||||
|
||||
from electrum.plugins.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.plugins.hw_wallet.trezor_qt_pinmatrix import PinMatrixWidget
|
||||
from electrum.plugins.hw_wallet.plugin import only_hook_if_libraries_available
|
||||
from electrum.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.hw_wallet.trezor_qt_pinmatrix import PinMatrixWidget
|
||||
from electrum.hw_wallet.plugin import only_hook_if_libraries_available
|
||||
|
||||
from .keepkey import KeepKeyPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC, TIM_PRIVKEY
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from electrum.plugin import hook
|
||||
from electrum.hw_wallet import CmdLineHandler
|
||||
|
||||
from .ledger import LedgerPlugin
|
||||
from ..hw_wallet import CmdLineHandler
|
||||
|
||||
class Plugin(LedgerPlugin):
|
||||
handler = CmdLineHandler()
|
||||
|
||||
@@ -21,9 +21,9 @@ from electrum.transaction import PartialTransaction, Transaction, PartialTxInput
|
||||
from electrum.util import bfh, UserFacingException, versiontuple
|
||||
from electrum.wallet import Standard_Wallet
|
||||
|
||||
from ..hw_wallet import HardwareClientBase, HW_PluginBase
|
||||
from ..hw_wallet.plugin import is_any_tx_output_on_change_branch, validate_op_return_output, LibraryFoundButUnusable
|
||||
from ..hw_wallet.plugin import HardwareClientDummy
|
||||
from electrum.hw_wallet import HardwareClientBase, HW_PluginBase
|
||||
from electrum.hw_wallet.plugin import is_any_tx_output_on_change_branch, validate_op_return_output, LibraryFoundButUnusable
|
||||
from electrum.hw_wallet.plugin import HardwareClientDummy
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from electrum.plugin import DeviceInfo
|
||||
|
||||
@@ -7,10 +7,10 @@ from PyQt6.QtWidgets import QInputDialog, QLineEdit
|
||||
from electrum.i18n import _
|
||||
from electrum.plugin import hook
|
||||
from electrum.wallet import Standard_Wallet
|
||||
from electrum.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.hw_wallet.plugin import only_hook_if_libraries_available
|
||||
|
||||
from .ledger import LedgerPlugin, Ledger_Client
|
||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from ..hw_wallet.plugin import only_hook_if_libraries_available
|
||||
from electrum.gui.qt.wizard.wallet import WCScriptAndDerivation, WCHWUninitialized, WCHWUnlock, WCHWXPub
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
@@ -10,7 +10,7 @@ from electrum.keystore import bip39_normalize_passphrase
|
||||
from electrum.bip32 import BIP32Node, convert_bip32_strpath_to_intpath
|
||||
from electrum.logging import Logger
|
||||
from electrum.plugin import runs_in_hwd_thread
|
||||
from electrum.plugins.hw_wallet.plugin import HardwareClientBase, HardwareHandlerBase
|
||||
from electrum.hw_wallet.plugin import HardwareClientBase, HardwareHandlerBase
|
||||
|
||||
|
||||
class GuiMixin(object):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from electrum.plugin import hook
|
||||
from electrum.hw_wallet import CmdLineHandler
|
||||
|
||||
from .safe_t import SafeTPlugin
|
||||
from ..hw_wallet import CmdLineHandler
|
||||
|
||||
class Plugin(SafeTPlugin):
|
||||
handler = CmdLineHandler()
|
||||
|
||||
@@ -15,9 +15,9 @@ from electrum.i18n import _
|
||||
from electrum.plugin import hook
|
||||
from electrum.logging import Logger
|
||||
|
||||
from electrum.plugins.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.plugins.hw_wallet.trezor_qt_pinmatrix import PinMatrixWidget
|
||||
from electrum.plugins.hw_wallet.plugin import only_hook_if_libraries_available
|
||||
from electrum.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.hw_wallet.trezor_qt_pinmatrix import PinMatrixWidget
|
||||
from electrum.hw_wallet.plugin import only_hook_if_libraries_available
|
||||
|
||||
from .safe_t import SafeTPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC, TIM_PRIVKEY
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ from electrum.plugin import Device, runs_in_hwd_thread
|
||||
from electrum.transaction import Transaction, PartialTransaction, PartialTxInput, Sighash
|
||||
from electrum.keystore import Hardware_KeyStore
|
||||
|
||||
from ..hw_wallet import HW_PluginBase
|
||||
from ..hw_wallet.plugin import is_any_tx_output_on_change_branch, trezor_validate_op_return_output_and_get_data
|
||||
from electrum.hw_wallet import HW_PluginBase
|
||||
from electrum.hw_wallet.plugin import is_any_tx_output_on_change_branch, trezor_validate_op_return_output_and_get_data
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .client import SafeTClient
|
||||
|
||||
@@ -9,7 +9,7 @@ from electrum.keystore import bip39_normalize_passphrase
|
||||
from electrum.bip32 import BIP32Node, convert_bip32_strpath_to_intpath as parse_path
|
||||
from electrum.logging import Logger
|
||||
from electrum.plugin import runs_in_hwd_thread
|
||||
from electrum.plugins.hw_wallet.plugin import OutdatedHwFirmwareException, HardwareClientBase
|
||||
from electrum.hw_wallet.plugin import OutdatedHwFirmwareException, HardwareClientBase
|
||||
|
||||
from trezorlib.client import TrezorClient, PASSPHRASE_ON_DEVICE
|
||||
from trezorlib.exceptions import TrezorFailure, Cancelled, OutdatedFirmwareError
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from electrum.plugin import hook
|
||||
from electrum.i18n import _
|
||||
from electrum.util import print_stderr
|
||||
from electrum.hw_wallet import CmdLineHandler
|
||||
|
||||
from .trezor import TrezorPlugin, PASSPHRASE_ON_DEVICE
|
||||
from ..hw_wallet import CmdLineHandler
|
||||
|
||||
class TrezorCmdLineHandler(CmdLineHandler):
|
||||
def __init__(self):
|
||||
|
||||
@@ -13,9 +13,9 @@ from electrum.logging import Logger
|
||||
from electrum.plugin import hook
|
||||
from electrum.keystore import ScriptTypeNotSupported
|
||||
|
||||
from electrum.plugins.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.plugins.hw_wallet.trezor_qt_pinmatrix import PinMatrixWidget
|
||||
from electrum.plugins.hw_wallet.plugin import only_hook_if_libraries_available, OutdatedHwFirmwareException
|
||||
from electrum.hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||
from electrum.hw_wallet.trezor_qt_pinmatrix import PinMatrixWidget
|
||||
from electrum.hw_wallet.plugin import only_hook_if_libraries_available, OutdatedHwFirmwareException
|
||||
|
||||
from electrum.gui.qt.util import (WindowModalDialog, WWLabel, Buttons, CancelButton,
|
||||
OkButton, CloseButton, PasswordLineEdit, getOpenFileName, ChoiceWidget)
|
||||
|
||||
@@ -10,8 +10,8 @@ from electrum.transaction import Transaction, PartialTransaction, PartialTxInput
|
||||
from electrum.keystore import Hardware_KeyStore
|
||||
from electrum.logging import get_logger
|
||||
|
||||
from electrum.plugins.hw_wallet import HW_PluginBase
|
||||
from electrum.plugins.hw_wallet.plugin import is_any_tx_output_on_change_branch, \
|
||||
from electrum.hw_wallet import HW_PluginBase
|
||||
from electrum.hw_wallet.plugin import is_any_tx_output_on_change_branch, \
|
||||
trezor_validate_op_return_output_and_get_data, LibraryFoundButUnusable, OutdatedHwFirmwareException
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
Reference in New Issue
Block a user