Commit graph

34 commits

Author SHA1 Message Date
kodxana
990e7c55bf
Update plugin.py 2020-11-18 20:49:25 +01:00
SomberNight
88307357ec
add some type hints
mostly related to hw wallets
2019-11-22 22:59:33 +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
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
9372eacc29
hw wallets: show DeviceUnpairableError nicely in qt gui
need to subclass UserFacingException for main_window.on_error
2019-09-03 19:19:58 +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
811169da4b
plugins: on some systems plugins with relative imports failed to load
this caused electrum to fail to start
potentially only older python 3.6.x are affected

fixes #5421
2019-06-12 20:07:36 +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
37da192bf5
wizard/hw: less spammy logs when hw library unavailable
closes #5380
2019-05-26 17:01:01 +02:00
SomberNight
104b8804f7
logging: '-V' cli option can blacklist/whitelist classes with short names
for example, '-V ni' will whitelist the 'Network' and 'Interface' classes
'-V ^ni' will blacklist those instead
2019-05-07 21:07:18 +02:00
SomberNight
6940c424d1
logging: cli options to filter for modules using -v
old style "-v" still works

filtering examples:
-v=debug,network=error,interface=error      // effectively blacklists network and interface
-v=warning,network=debug,interface=debug    // effectively whitelists network and interface
2019-05-02 15:19:10 +02:00
SomberNight
3385a94753
logging: basics 2019-05-02 15:19:03 +02:00
SomberNight
f2ad116b0b
wizard: better hww debug messages when unpaired_device_infos fails
[DeviceMgr] scanning devices...
[DeviceMgr] failed to create client for ledger at b'0002:0007:00': OSError('open failed',)
[DeviceMgr] error getting device infos for ledger: open failed

^ GUI did not contain any info about failure
2019-01-21 18:44:36 +01:00
SomberNight
ba33bc4ad8
plugins: fix hook/attr name collision in close()
Revealer plugin has method "password_dialog"
"password_dialog" is also a hook name, but revealer.password_dialog is not a hook
2018-12-19 02:10:47 +01:00
SomberNight
32af83b7ae
wizard/hw: show transport type when listing HWDs 2018-11-16 19:03:25 +01:00
SomberNight
e04e8d2365
plugins: when loading plugins, use newer importlib mechanism
fixes #4842
2018-11-11 23:55:34 +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
0862fdb9a9
plugins: somewhat clearer exception is loading plugin fails
see #4817 (issuecomment-434778055)
2018-10-31 18:33:28 +01:00
SomberNight
386e0d560e
wizard,hw: tell user about errors during plugin init
see #4817 (issuecomment-434765570)
2018-10-31 17:58:47 +01:00
SomberNight
9037f25da1
kill old-style namedtuples 2018-10-28 00:28:29 +02:00
SomberNight
a88a2dea82
split bip32 from bitcoin.py 2018-10-25 22:20:33 +02:00
SomberNight
c4e09fa874
simplify Plugins constructor 2018-10-22 18:21:38 +02:00
SomberNight
81cc20039e
more type annotations in core lib 2018-10-22 16:41:25 +02:00
SomberNight
5e4a4ae16b
minor clean-up (prints/types/imports) 2018-09-28 17:58:46 +02:00
SomberNight
952e9b87e1
network: clean-up. make external API clear. rm interface_lock (mostly). 2018-09-25 16:44:39 +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
7307c800d7
small optimisations for history tab refresh (and related) 2018-08-03 16:12:41 +02:00
Janus
780b2d067c Whitelist classes in verbose (-v) option 2018-07-19 01:21:33 +02:00
Janus
87f6aa09df log failure to import plugins or plot module 2018-07-13 15:24:16 +02:00
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00
Renamed from lib/plugins.py (Browse further)