Commit Graph

39 Commits

Author SHA1 Message Date
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 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 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 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 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 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 a8e81c0bd2 keepkey: use libusb to enumerate devices instead of hid 2019-12-20 01:30:10 +01:00
SomberNight c2b0039935 bitcoin.py: remove some remnants of TYPE_ADDRESS, TYPE_SCRIPT 2019-11-21 18:51:38 +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 3385a94753 logging: basics 2019-05-02 15:19:03 +02:00
keepkeyjon ef7af73bd3 keepkey: support v6.0.0+ firmwares (webusb) 2019-03-17 14:08:23 -06: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 7bbec04a06 trezor: implement "seedless" mode (option during initialization) 2019-02-13 20:35:23 +01:00
SomberNight 0f0cee422e trezor and clones: sign tx version too 2019-01-30 12:03:52 +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 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 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 https://github.com/fyookball/electrum/pull/765/commits/86c63a3a084951c87789346e1d9de35f4cede055
2018-07-31 13:03:34 +02:00
SomberNight e1b2195cf7 fix #4591: pay to OP_RETURN on trezor 2018-07-31 12:30:43 +02:00
SomberNight 8f17f38b02 trezor/kk: when using old fw, wizard did not display instructions properly 2018-07-18 20:17:03 +02:00
Yura Pakhuchiy 27b36486df Trezor: fix spending coinbase outputs (#4565)
Attempt to spend coinbase output results in error:
a bytes-like object is required, not 'str'
2018-07-18 17:39:32 +02:00
Janus 097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00