Commit graph

41 commits

Author SHA1 Message Date
SomberNight
2cfa3bd6c8
hww hidapi usage: try to mitigate some thread-safety issues
related: #6097
2020-04-17 19:53:39 +02:00
SomberNight
98d2ab5bd6
hww: fix HardwareClientBase not having reference to plugin
it was incorrectly documented that it did (previously only for some plugins)
2020-04-17 19:53:35 +02:00
SomberNight
e830ef309f
hww: factor out part of hid scan code to HW_PluginBase
so that bitbox02 can override it
2020-04-12 15:34:19 +02:00
SomberNight
c0c3627bd2
bitbox02: adapt to updated master 2020-04-12 15:34:19 +02:00
SomberNight
4b1d835304
wizard hww: scan devices fewer times and move away from GUI thread 2020-04-09 19:45:31 +02:00
SomberNight
bf067f7558
HardwareClientBase: provide default implementation for label
and add warning about placeholders
2020-04-08 18:28:21 +02:00
SomberNight
db1ff4915f
hww: show model name in device enum lists (e.g. "Trezor T") 2020-04-08 17:53:40 +02:00
SomberNight
4ef313a1ac
hww: smarter auto-selection of which device to pair with
scenario1:
- 2of2 multisig wallet with trezor1 and trezor2 keystores
- only trezor2 connected
- previously we would pair first keystore with connected device and then display error.
  now we will pair the device with the correct keystore on the first try

scenario2:
- standard wallet with trezor1 keystore
- trezor2 connected (different device)
- previously we would pair trezor2 with the keystore and then display error.
  now we will prompt the user to select which device to pair with (out of one)

related: #5789
2020-04-08 17:53:33 +02:00
SomberNight
9d0bb295e6
hww: distinguish devices based on "soft device id" (not just labels)
fixes #5759
2020-04-08 14:44:42 +02:00
SomberNight
caefea19dd
trezor pin dialog: only show PIN "strength" when creating/changing
fixes #4832
2020-04-07 18:58:45 +02:00
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
18d245ad5c
hw wallets: during wallet creation, make sure to save correct label
When initialising a Trezor as part of the wallet creation,
device_info.label is still the old (None) label in on_hw_derivation.
This is because device_info was created during the initial scan.

related: #6063
2020-03-31 15:56:54 +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
f8ba660583
clean-up hw-wallet "get_password_for_storage_encryption"-related code 2020-02-28 19:47:56 +01:00
SomberNight
6b8c447eb9
ledger: support sending to OP_RETURN outputs
closes #5849

based on:
ca9b432ff0
7bb27eff84
2019-12-17 21:10:14 +01:00
SomberNight
d3fd87ebd0
hardware wallets: wizard no longer requests xpub at path "m"
This was done to calculate the bip32 root fingerprint but it broke
the digitalbitbox. The keystore already had a different way to get
the root fingerprint for existing wallets, specifically handling this
case; the code in base_wizard used when creating new wallets was
duplicating that code originally and was then forgotten to be updated.
Now these codepaths are unified.

closes #5816
2019-12-02 19:31:17 +01:00
SomberNight
88307357ec
add some type hints
mostly related to hw wallets
2019-11-22 22:59:33 +01:00
SomberNight
c2b0039935
bitcoin.py: remove some remnants of TYPE_ADDRESS, TYPE_SCRIPT 2019-11-21 18:51:38 +01:00
SomberNight
b8e4ce9ba1
hardware wallets: handle when label is None
follow-up 56c3de0e1e
2019-11-18 18:13:26 +01:00
SomberNight
56c3de0e1e
hardware wallets: better handle label collision when selecting device
related: #5759
2019-11-17 01:15:44 +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
e6c841d05f
psbt: put fake xpubs into globals. keystores handle xfp/der_prefix missing 2019-11-04 22:24:59 +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
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
SomberNight
e7f38467d7
move opcodes to bitcoin.py 2019-02-22 17:39:58 +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
matejcik
5411ad9633 plugins can also check maximum library version 2018-11-27 15:32:33 +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
9037f25da1
kill old-style namedtuples 2018-10-28 00:28:29 +02:00
SomberNight
70c32590a9
hw plugins: fix only_hook_if_libraries_available
follow-up f9a5f2e183
2018-09-30 00:25:36 +02:00
SomberNight
f9a5f2e183
fix #4698 2018-09-19 20:02:03 +02:00
SomberNight
91c369e392
hw wallets: generalise 'minimum_library' for those that provide a version number 2018-08-23 18:31:14 +02:00
SomberNight
5f3408dd70
transaction.py: introduce TxOutputHwInfo namedtuple 2018-08-14 19:15:15 +02:00
SomberNight
2eb72d496f
transaction: introduce TxOutput namedtuple 2018-08-01 19:10:08 +02:00
SomberNight
c9c8b7656d
follow-up prev. sanity check OP_RETURN outputs
based on 86c63a3a08
2018-07-31 13:03:34 +02:00
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00
Renamed from plugins/hw_wallet/plugin.py (Browse further)