Commit graph

63 commits

Author SHA1 Message Date
SomberNight
371f55a0f9
hww: fix some threading issues in wizard
fixes #3377
related: #6064  (passphrase dialog not rendered correctly)
2020-04-01 21:09:17 +02:00
SomberNight
81fc3fcce2
hww: rm some code duplication: add "scan_and_create_client_for_device" 2020-04-01 21:09:14 +02:00
SomberNight
e6d43b60fa
qt hww show_settings_dialog: don't scan devices in GUI thread
Just makes sense in general.
Also, previously, the GUI would freeze if right after startup the user
clicked the hww status bar icon (especially with multiple hww connected).
2020-04-01 21:09:06 +02:00
SomberNight
7f1c7955dc
DeviceMgr: clean-up locks a bit 2020-04-01 21:09:00 +02:00
SomberNight
6760c3f252
hw wallets: introduce HardwareHandlerBase
previously, client.handler was sometimes
- an InstallWizard
- a QtHandlerBase where win was an ElectrumWindow
- a QtHandlerBase where win was an InstallWizard
- a CmdLineHandler

That's just too much dynamic untyped undocumented polymorphism...
Now it will never be an InstallWizard (replaced with QtHandlerBase where win is an InstallWizard),
and now in all cases client.handler is an instance of HardwareHandlerBase, yay.

related: #6063
2020-03-31 14:40:25 +02:00
SomberNight
d2f132738a
wallet: only select mature coins by default
this is a regression from #5721

Removed the `TxInput.is_coinbase` method as I think it is a confusing API,
instead we now have `TxInput.is_coinbase_input` and `TxInput.is_coinbase_output`.

related #5872
2020-01-02 00:43:49 +01:00
SomberNight
18209fc782
trezor: when restoring, hide Shamir options by default
They become visible once user clicks "Show expert settings"
2019-12-19 16:50:35 +01:00
matejcik
006c6c1a58 trezor: use BIP39 backup by default even if Shamir is available 2019-12-18 12:36:13 +01:00
matejcik
da41e4c289 trezor: bump library requirement 2019-12-18 12:36:13 +01:00
matejcik
3fc70bd97a trezor: implement support for Shamir recovery 2019-12-18 12:36:13 +01:00
matejcik
f4e2781786 trezor: link button messages to enum names 2019-12-18 12:36:13 +01:00
SomberNight
428b63822b
trezor: rm obsolete gui text 2019-12-04 20:54:53 +01:00
SomberNight
c2b0039935
bitcoin.py: remove some remnants of TYPE_ADDRESS, TYPE_SCRIPT 2019-11-21 18:51:38 +01:00
SomberNight
f8c84fbb1e
hardware wallets: create base class for HW Clients. add some type hints 2019-11-11 17:04:12 +01:00
SomberNight
cc4f6804b0
psbt: follow-ups: fix trezor 2019-11-05 23:32:00 +01:00
SomberNight
bafe8a2fff
integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
ab76a1fe5b
wallet.add_hw_info: also store "is_change" in output_info
as it seems every consumer wants to know this and has its own hacks to
figure it out
2019-09-03 14:34:10 +02:00
SomberNight
f60f690ca9
change many str(e) to repr(e) as some exceptions were cryptic
it's often valuable to see the type of the exception
(especially as for some exceptions str(e) == '')
2019-07-17 20:12:52 +02:00
SomberNight
fb76fcc886
trezor: use only Bridge when available
fixes #5420
2019-07-02 21:21:39 +02:00
SomberNight
371e1a6ebf
hw: allow bypassing "too old firmware" error when using hw wallets
The framework here is generic enough that it can be used for any hw plugin,
however atm only Trezor is implemented.

closes #5391
2019-05-31 04:09:03 +02:00
SomberNight
3385a94753
logging: basics 2019-05-02 15:19:03 +02:00
Calin Culianu
05697e51b8
Trezor: Minor nit in settings screen. Image size was shown as H x W
(from Electron-Cash/Electron-Cash@e0e7ff218d)
2019-04-29 19:28:42 +02:00
ghost43
6617307730
Merge pull request #5118 from SomberNight/trezor_init_20190213
Trezor: implement "seedless" mode
2019-02-22 18:59:52 +01:00
SomberNight
85a7aa291e
bip32: refactor whole module. clean-up. 2019-02-22 18:50:24 +01:00
SomberNight
5387c6d5f6
trezor: during device init hide some options behind an "expert" button 2019-02-13 20:35:24 +01:00
SomberNight
7bbec04a06
trezor: implement "seedless" mode (option during initialization) 2019-02-13 20:35:23 +01:00
SomberNight
ec86850a2e
trezor: fix minor error handling issue
AttributeError: 'TrezorFailure' object has no attribute 'message'
2019-02-13 18:33:48 +01:00
SomberNight
026448837f
no more "import *"
fixes #5101
fixes #5105
2019-02-11 20:21:24 +01:00
SomberNight
7bb3e5336a
trezor: PIN could not be disabled
fixes #5078
2019-02-06 15:50:57 +01:00
SomberNight
16bac5fd73
rm qt icons file
so we don't need pyrcc5, which is not deterministic,
and so we don't need the submodule for the icons

based on electrumsv/electrumsv@bf8802c2ea
2019-02-01 20:15:28 +01:00
SomberNight
0f0cee422e
trezor and clones: sign tx version too 2019-01-30 12:03:52 +01:00
SomberNight
27299092df
hardware cmdline handler: print messages to stderr (take 2)
follow-up 5613f9b903

button_request should not call show_error as error dialogs in Qt block
the GUI thread.
2019-01-29 17:25:02 +01:00
ThomasV
5613f9b903 hardware cmdline handler: print messages to stderr 2019-01-25 18:16:03 +01:00
SomberNight
c7f3adb67e
trezor: fix minor string formatting re translations
closes #4996
2019-01-16 19:11:04 +01:00
SomberNight
192ec8596d
trezor: fix matrix recovery
closes #4983
2019-01-04 10:15:26 +01:00
SomberNight
bd1f7b539e
qt: don't import PyQt5.Qt
related #4960
2018-12-26 03:58:50 +01:00
SomberNight
8c3920a0db
hw: check_libraries_available now gets version of incompatible libs
previously we would return early and the user would
just see "missing libraries"
2018-12-06 19:39:58 +01:00
SomberNight
20fa7fc2f7
trezor: fix sign_transaction prev_tx 2018-12-06 19:37:12 +01:00
SomberNight
9e86bc586c
trezor: only confirm passphrase when creating wallet
but not when decrypting
2018-12-06 19:37:11 +01:00
matejcik
8e681c1723 trezor: update name (TREZOR -> Trezor) 2018-12-05 15:44:24 +01:00
matejcik
43acd09df8 trezor: support outdated firmware notifications
Outdated firmware error messages were originally raised from
create_client, which would mean that a client for an outdated device
would not be created.

This had a number of undesirable outcomes due to "client does not exist"
being conflated with "no device is connected".

Instead, we raise in setup_client (which prevents creating new wallets
with outdated devices, BUT shows them in device list), and python-trezor
also raises on most calls (which gives us an error message when opening
wallet and/or trying to do basically anything with it).

This is still suboptimal - i.e., there's currently no way for Electrum to
claim higher version requirement than the underlying python-trezor, and
so minimum_firmware property is pretty much useless ATM.
2018-12-05 14:26:19 +01:00
matejcik
8571cafcc8 trezor: call get_xpub with correct argument
`creating` indicates that this is a new wallet. Which is always the case
in `setup_device`
2018-12-05 14:24:32 +01:00
matejcik
c33c907330 trezor: update to trezor 0.11.0 2018-11-27 15:34:19 +01:00
SomberNight
32af83b7ae
wizard/hw: show transport type when listing HWDs 2018-11-16 19:03:25 +01:00
SomberNight
bd32b88f62
introduce UserFacingException
we should not raise generic Exception when wanting to communicate with
the user. it makes distinguishing programming errors and messages hard,
as the caller will necessarily need to catch all Exceptions then
2018-11-08 19:46:15 +01:00
SomberNight
dace2e5495
trezor: don't let bridge transport failing block all other transports
[trezor] connecting to device at bridge:hid...
[trezor] connected to device at bridge:hid...
Traceback (most recent call last):
  File "...\electrum\electrum\base_wizard.py", line 255, in choose_hw_device
    u = devmgr.unpaired_device_infos(None, plugin, devices=scanned_devices)
  File "...\electrum\electrum\plugin.py", line 501, in unpaired_device_infos
    client = self.create_client(device, handler, plugin)
  File "...\electrum\electrum\plugin.py", line 374, in create_client
    client = plugin.create_client(device, handler)
  File "...\electrum\electrum\plugins\trezor\trezor.py", line 124, in create_client
    client = self.client_class(transport, handler, self)
  File "...\electrum\electrum\plugins\trezor\client.py", line 7, in __init__
    ProtocolMixin.__init__(self, transport=transport)
  File "...\Python36-32\lib\site-packages\trezorlib\client.py", line 444, in __init__
    self.init_device()
  File "...\Python36-32\lib\site-packages\trezorlib\client.py", line 454, in init_device
    self.features = expect(proto.Features)(self.call)(init_msg)
  File "...\Python36-32\lib\site-packages\trezorlib\client.py", line 115, in wrapped_f
    ret = f(*args, **kwargs)
  File "...\Python36-32\lib\site-packages\trezorlib\client.py", line 129, in wrapped_f
    client.transport.session_begin()
  File "...\Python36-32\lib\site-packages\trezorlib\transport\__init__.py", line 42, in session_begin
    self.open()
  File "...\Python36-32\lib\site-packages\trezorlib\transport\bridge.py", line 69, in open
    raise TransportException('trezord: Could not acquire session' + get_error(r))
trezorlib.transport.TransportException: trezord: Could not acquire session (error=400 str=wrong previous session)
[DeviceMgr] error getting device infos for trezor: trezord: Could not acquire session (error=400 str=wrong previous session)
2018-11-08 17:07:05 +01:00
SomberNight
a88a2dea82
split bip32 from bitcoin.py 2018-10-25 22:20:33 +02:00
SomberNight
ab1ec57429
trezor and clones: rm dead code
see Electron-Cash/Electron-Cash#872
see Electron-Cash/Electron-Cash#874
2018-09-30 02:10:17 +02:00
SomberNight
8aebb8249a
keepkey: full segwit support
ported from trezor plugin
needs new fw to work (5.8??)

fixes #3462
2018-09-30 01:29:27 +02:00
SomberNight
70c32590a9
hw plugins: fix only_hook_if_libraries_available
follow-up f9a5f2e183
2018-09-30 00:25:36 +02:00