1
0
Commit Graph

83 Commits

Author SHA1 Message Date
ThomasV
b86be552e7 hardware wallets: show address on device also from tx dialog 2025-05-06 18:22:07 +00:00
SomberNight
ba3783f998 refactor qt.util.ChoiceWidget: introduce ChoiceItem 2025-05-06 18:12:37 +00:00
ThomasV
c93b13f6d9 Make it possible to create zip plugins from internal plugins
specifically:
 - add 'name' field to manifest.json
 - make 'version' optional in contrib/make_plugin
 - fix import in jade plugin
2025-04-14 11:54:04 +02:00
ThomasV
6e087950cf move hw_wallet.py from plugins to electrum library 2025-04-10 10:19:15 +02:00
f321x
a9f8048251 use manifest.json instead of loading init file for plugin registration 2025-03-19 10:38:20 +01:00
ThomasV
eccc5900e0 move plugin icons to plugins 2024-10-17 13:32:30 +02:00
SomberNight
ecf0a5854d hw plugins: adapt trezor_qt_pinmatrix.py to qt6
This fixes the pinmatrix dialog (used by trezor one, keepkey, safet),
which was previously segfaulting.

follow-up https://github.com/spesmilo/electrum/pull/9189
2024-10-10 20:24:09 +00:00
SomberNight
48661b5913 follow-up electrum_ecc: fix some import names
ref https://github.com/spesmilo/electrum/pull/9234
2024-10-10 19:24:27 +00:00
SomberNight
cfe8502f96 qt desktop gui: upgrade qt5->qt6
closes https://github.com/spesmilo/electrum/issues/8007
2024-09-18 15:48:38 +00:00
SomberNight
2f1095510c bitcoin.py/transaction.py: API changes: rm most hex usage
Instead of some functions operating with hex strings,
and others using bytes, this consolidates most things to use bytes.

This mainly focuses on bitcoin.py and transaction.py,
and then adapts the API usages in other files.

Notably,
- scripts,
- pubkeys,
- signatures
should be bytes in almost all places now.
2024-04-29 17:10:26 +00:00
Sander van Grieken
643fbecc15 wizard: fix co-signing hardware wallets data incorrectly referenced 2024-02-14 12:42:15 +01:00
SomberNight
fffbc178cd qt wizard: hww dialogs: log some exceptions more aggressively
sort of related: https://github.com/spesmilo/electrum/issues/8892
2024-02-14 09:05:21 +00:00
Sander van Grieken
2882c4be46 qt: consistency HWW wizard page translations 2024-02-06 10:59:59 +01:00
Sander van Grieken
0a2a22b822 qt: use selected_key instead of selected_item[0] for ChoiceWidgets 2024-02-05 14:39:03 +01:00
Sander van Grieken
78fbc27ec0 qt: remove potentially confusing reference to 'install wizard' in trezor, keepkey, safe_t hww settings dialogs 2023-09-22 12:13:21 +02:00
Sander van Grieken
22d3a5edbb wizard: fix trezor initialisation/recover not setting page valid to True
add auto-proceed to next page after init to trezor, safe_t, keepkey
2023-09-20 14:34:31 +02:00
Sander van Grieken
7313259815 wizard: keepkey and safe_t set valid on init, handle xprv validation, report error when exception 2023-09-20 14:34:31 +02:00
Sander van Grieken
60d1d1e599 wizard: add missing keepkey porting, fix password focus for default and picked wallets,
add abstract method decl HW_PluginBase.wizard_entry_for_device
2023-09-20 14:34:31 +02:00
Sander van Grieken
087718f3a7 hww: mark device_model_name(self) as @abstractmethod and override in hww clients that did not define it. 2023-09-20 14:34:31 +02:00
Sander van Grieken
0aebc1a31e qt+plugins: cleanup. remove all old wizard code 2023-09-20 14:34:31 +02:00
Sander van Grieken
8747ff3778 small fixes, imports 2023-09-20 14:34:31 +02:00
Sander van Grieken
ecc3004aee qt: safe_t device init
Note: untested, don't have device
2023-09-20 14:34:31 +02:00
Sander van Grieken
f23bd33451 wizard: add safe_t, except for wallet initial setup support. 2023-09-20 14:34:31 +02:00
SomberNight
be159b5b95 bugfix: assert walrus (":=") combo side-eff. breaks w/ asserts disabled
```
$ python3 -O
Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> assert (x := 2)
>>> x
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'x' is not defined
```

pity. it looked to be a neat and concise pattern.
2023-04-20 15:17:36 +00:00
SomberNight
7746cc8e60 bip32: (trivial) rename method strpath_to_intpath, for symmetry
Required a much higher mental load to parse the name "convert_bip32_path_to_list_of_uint32"
than to parse "convert_bip32_strpath_to_intpath".
And we already have the ~inverse: "convert_bip32_intpath_to_strpath".
2023-03-10 14:23:17 +00:00
SomberNight
e457bb50e9 trezor: TrezorPlugin._make_multisig to use MultisigDescriptor
This fixes a regression where the plugin was assuming ordering for
txin.pubkeys (which is now a set).
(previously txin.pubkeys was a list ordered according to the final
sort order of keys inside the bitcoin script)
2023-03-03 16:40:41 +00:00
SomberNight
0647a2cf9f transaction.py: rm PartialTxInput.{num_sig, script_type} 2023-03-03 16:40:12 +00:00
SomberNight
373db76ac9 util: kill bh2u
no longer useful, and the name is so confusing...
2023-02-17 11:43:11 +00:00
SomberNight
1ce37c8bb1 transaction: rm hardcoded sighash magic numbers 2023-02-17 11:40:12 +00:00
SomberNight
b5d3f1458a hww: impl get_client in Hardware_KeyStore instead of subclasses 2022-06-03 17:14:44 +02:00
SomberNight
98feff07ad threading.Thread: fix some DeprecationWarnings
"DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead"
2022-05-23 17:52:39 +02:00
SomberNight
376fc01b27 keystore.sign_message: add optional script_type argument
this is used by trezor
(and also by bitbox02, which was using a workaround previously)

fixes https://github.com/spesmilo/electrum/issues/7670
2022-02-22 19:20:03 +01:00
Benoit Verret
f731c38293 Minor style changes 2021-03-21 00:36:23 -04:00
SomberNight
b28b3994c7 qt: move window.get{Open,Save}FileName to util
Sometimes we want its "remember path" behaviour but it does not make sense to
parent the dialog from main window. When so, caller code no longer needs to
get a reference to a main window.

Also rm last usages of get_parent_main_window().
2020-12-20 15:25:35 +01:00
SomberNight
eefb68c82b transaction: change Transaction.is_segwit_input(txin) to txin.is_segwit() 2020-10-24 08:03:13 +02:00
ghost43
21c3572600 hardware devices: run all device communication on dedicated thread (#6561)
hidapi/libusb etc are not thread-safe.

related: #6554
2020-09-08 15:52:53 +00: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
4b1d835304 wizard hww: scan devices fewer times and move away from GUI thread 2020-04-09 19:45:31 +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
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
7f8d667e85 Revert "qt/hww: temporarily bundle our own version of safetlib.qt.pinmatrix"
This reverts commit 7f3de8241c.

(can finally undo this due to bb94712a14)
2020-02-21 18:32:58 +01: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
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