Sander van Grieken
3c9c6a286c
imports, whitespace, type hints, copyright headers
2025-06-12 14:32:00 +02:00
SomberNight
3e4601c61d
base64.b64decode: always set validate=True
...
Notably verifymessage and decrypt(message) were silently ignoring trailing garbage
or inserted non-base64 characters present in signatures/ciphertext.
(both the CLI commands and in the GUI)
I think it is much cleaner and preferable to treat such signatures/ciphertext as invalid.
In fact I find it surprising that base64.b64decode(validate=False) is the default.
Perhaps we should create a helper function for it that set validate=True and use that.
2025-06-03 18:58:05 +00:00
ThomasV
a474b8674d
plugin commands:
...
- make plugin commands start with plugin name + underscore
- plugin_name must be passed to the plugin_command decorator
- fixes:
- remove plugin_commands (unneeded)
- func_wrapper must await func()
- setattr(Commands, name, func_wrapper)
- add push/pull commands to labels plugin
2025-03-16 11:53:34 +01:00
ThomasV
14ec36dba1
Merge pull request #8741 from accumulator/labels_update
...
add labels_received callback and update labels even when set for item
2024-01-11 16:05:04 +01:00
SomberNight
1d4a5052ef
labels plugin: add FIXMEs. don't roll your own crypto...
...
```
23.76 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 180
set_label. label='a1'. item='444dffaf758a1b17893cbc8dda4032f9b6e9f61115e7c1a6d486a0950de50c11'. bundle['encryptedLabel']='WzqTZD+cnoQEUrfYsBz0rg=='
28.10 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 181
set_label. label='a1'. item='4812e9844c958a913a71a5a728ea6d73e42d0618f96a4259bad1895b4f427f8e'. bundle['encryptedLabel']='WzqTZD+cnoQEUrfYsBz0rg=='
set_label. label='a1'. item='c5daddf7972e16e25c1362d492888a8bbf3d8dcfc789342d71dc83d9a8faaa6c'. bundle['encryptedLabel']='WzqTZD+cnoQEUrfYsBz0rg=='
36.51 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 182
set_label. label='a1'. item='be5973ddf9b6ae6949e544c3cf43a16e2a8719dcf14a1171ec94cfa25d4a3325'. bundle['encryptedLabel']='WzqTZD+cnoQEUrfYsBz0rg=='
45.68 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 183
set_label. label=''. item='444dffaf758a1b17893cbc8dda4032f9b6e9f61115e7c1a6d486a0950de50c11'. bundle['encryptedLabel']='yErvsmjQUEt4Ry8c55S3Mg=='
55.99 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 184
58.69 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 185
set_label. label=''. item='4812e9844c958a913a71a5a728ea6d73e42d0618f96a4259bad1895b4f427f8e'. bundle['encryptedLabel']='yErvsmjQUEt4Ry8c55S3Mg=='
set_label. label=''. item='c5daddf7972e16e25c1362d492888a8bbf3d8dcfc789342d71dc83d9a8faaa6c'. bundle['encryptedLabel']='yErvsmjQUEt4Ry8c55S3Mg=='
60.98 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 186
set_label. label=''. item='be5973ddf9b6ae6949e544c3cf43a16e2a8719dcf14a1171ec94cfa25d4a3325'. bundle['encryptedLabel']='yErvsmjQUEt4Ry8c55S3Mg=='
62.80 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 187
```
2023-12-19 01:24:17 +00:00
Sander van Grieken
3a22cb9c48
labels: emit callback when labels received.
...
write labels regardless if there's already a label set for an ID.
2023-12-12 16:24:13 +01:00
SomberNight
a187210f90
labels plugin: don't log received data
...
this log line is 120 KB for one of my wallets (not even cherry-picking a large one)
2023-08-10 14:31:15 +00:00
Sander van Grieken
b6863b4854
qml: add LabelSync toggle
2023-07-11 12:51:37 +02:00
SomberNight
312f2641e7
don't use bare except
...
use "except Exception", or if really needed explicitly "except BaseException"
2023-04-24 12:58:01 +00:00
SomberNight
7b095158bf
wallet: add get_label_for_address, and make get_label private
...
fixes https://github.com/spesmilo/electrum/issues/7919
In the past, when creating payment requests, we keyed them by on-chain address,
and set/saved the msg of the request as label for the address.
Many places in the code were calling wallet.get_label(addr) with the expectation that
relevant payment requests are found and their message/description (if any) is considered.
wallet.get_label(key) is now made private, and instead the explicit non-polymorphic
wallet.get_label_for_{address,rhash,txid} alternatives should be used.
2022-08-09 17:21:14 +02:00
ThomasV
ad9030bd15
labels plugin: handle setting a label to None
2022-07-29 09:38:15 +02:00
SomberNight
c616c3bfad
plugins/labels: better error message when using imported wallets
...
see #6703
2020-11-05 01:59:19 +01:00
SomberNight
4b6c86ecbe
wallet: make labels private, and access to need lock
...
e.g. labels plugin iterated over wallet.labels on asyncio thread while user could trigger an edit from Qt thread
2020-10-13 18:57:55 +02:00
SomberNight
24221f8fca
plugins: fix labels plugin FIXME re "just enabled plugin"
2020-05-25 17:31:13 +02:00
ThomasV
e1ce3aace7
Separate db from storage
...
- storage is content-agnostic
- db and storage are passed to wallet contructor
2020-02-10 17:45:23 +01:00
ThomasV
dbceed2647
Restructure wallet storage:
...
- Perform json deserializations in wallet_db
- use StoredDict class that keeps tracks of its modifications
2020-02-04 13:35:58 +01: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
SomberNight
8c3ab63504
labels: don't dump trace if failed to connect to server
2019-03-22 17:24:52 +01:00
SomberNight
1f7b56b455
labels plugin: no need for 'proxy_set' callback
2019-03-09 17:13:06 +01:00
Janus
ec5f406f49
plugins: labels: dump response if malformed sync server response
2018-11-30 19:16:07 +01:00
SomberNight
e3b372946a
rm aiosafe decorator. instead: log_exceptions and ignore_exceptions
2018-10-12 18:36:48 +02:00
SomberNight
c4f3fbaca0
labels: fix potential threading issues
...
also handle --offline
2018-09-25 21:23:44 +02:00
Janus
617103bb2a
labels: fix saving single label
2018-09-06 18:30:24 +02:00
ThomasV
8fe066707a
rm import
2018-09-06 17:47:10 +02:00
Janus
6e80ba7b4f
asyncio: labels, crash_reporter, fx: migrate requests use to aiohttp
2018-09-06 16:18:45 +02:00
Janus
097ac144d9
file reorganization with top-level module
2018-07-13 14:01:37 +02:00