1
0
Commit Graph

17390 Commits

Author SHA1 Message Date
Sander van Grieken
6d2dfc9759 android: limit size of text pasted from clipboard, to avoid TransactionTooLargeException
https://developer.android.com/reference/android/os/TransactionTooLargeException.html
2024-02-21 11:22:00 +01:00
Sander van Grieken
de9c0249c7 qml: icons, styling 2024-02-19 14:38:29 +01:00
SomberNight
27bb28e35b tests: follow-up move of folder
follow-up https://github.com/spesmilo/electrum/pull/8897
2024-02-19 12:00:08 +00:00
Sander van Grieken
6ecbb8eb3f tests: add test for payment_identifier.invoice_from_payment_identifier() 2024-02-19 11:54:32 +01:00
accumulator
d968c6245c Merge pull request #8897 from accumulator/move_tests_to_root
tests: move /electrum/tests to /tests
2024-02-19 10:51:42 +01:00
Sander van Grieken
2b95223e2b qml: handle invoice removed from backend from qeinvoicelistmodel status update timer (fixes #8898) 2024-02-19 10:48:24 +01:00
Sander van Grieken
ef87fbd3e5 payment_identifier: return onchain invoice when GUI requests MAX amount (fixes #8900) 2024-02-19 10:35:55 +01:00
Sander van Grieken
4c6421e162 tests: fix CI regtest new path 2024-02-16 17:41:34 +01:00
Sander van Grieken
0faf6928c0 tests: explicit sync on self.app instance ready and make sure _testcase_event is cleared before
QMetaObject.invokeMethod as that can race if it gets inadvertently executed synchronously.
2024-02-16 16:56:14 +01:00
Sander van Grieken
73fee69f5c tests: move /electrum/tests to /tests 2024-02-16 15:40:45 +01:00
ghost43
e11d7b37f2 Merge pull request #8865 from SomberNight/202402_server_bookmarks
network: implement basic "add server as bookmark" functionality
2024-02-16 12:06:18 +00:00
accumulator
1b75e3883e Merge pull request #8845 from accumulator/feepicker
qml: consolidate fee slider ui in various places to a single FeePicker control
2024-02-16 13:01:34 +01:00
Sander van Grieken
016e500993 qml: FeePicker parameterize enable display of tx info and picker, use this for CPFP
to put picker in Total section
2024-02-16 12:56:18 +01:00
Sander van Grieken
c0b892720e qml: consolidate fee slider ui in various places to a single FeePicker control 2024-02-16 10:09:56 +01:00
Sander van Grieken
57270e3bf3 tests: qt_util: disable timer in qt testcases 2024-02-15 16:27:01 +01:00
Sander van Grieken
d8654361af peer_wire.csv: remove msgtype gossip_queries options, as the extract-formats.py tool
does not generate these anymore since aad959a297
2024-02-15 16:10:25 +01:00
SomberNight
ea4481a8dd android readme: de-dupe "qml_gui" requirements
follow-up https://github.com/spesmilo/electrum/pull/8881
2024-02-15 14:53:51 +00:00
ghost43
5582b753e5 Merge pull request #8881 from accumulator/qobject_test
add a simple test framework for testing QObjects and their signal/slot mechanism
2024-02-15 14:46:50 +00:00
ghost43
1d0706abd8 Merge pull request #8778 from SomberNight/202312_ci_py312
ci: also run unit tests with python 3.12
2024-02-15 14:40:35 +00:00
SomberNight
9a6ec61647 ci: also run unit tests with python 3.12 2024-02-15 14:22:31 +00:00
SomberNight
79d88dcb5f lnpeer: fix timing issue in reest_chan, for replaying unacked updates
We must not process incoming updates for a given channel until we ~finished reestablishing it.

Consider both parties have some unacked updates they want to replay during reestablish.
If Bob reacts to Alice's replayed stuff before he himself replays his stuff, madness ensues.

I think this should fix the remaining part of https://github.com/spesmilo/electrum/pull/8778
(timing issues when running the unit tests with py3.12)
2024-02-15 14:12:03 +00:00
ghost43
697968bcbb Merge pull request #7835 from SomberNight/202205_lnpeer_async_process_message
lnpeer: make `process_message` async
2024-02-15 14:04:18 +00:00
Sander van Grieken
a626d1bf42 tests: add test for QEAmount(from_invoice=..) and (m)satsStr properties 2024-02-15 13:36:10 +01:00
SomberNight
45e08ada61 lnpeer: make process_message async
This allows making any message handler async in lnpeer.

Note: `process_message` is only called from `_message_loop`.
There are(would be) basically three types of message handlers:
1. "traditional blocking msg handlers". non-async ones. When these handlers are called, `process_message` naturally blocks until the handler returns, which means `_message_loop` also blocks until the message is fully processed before starting the next iteration.
2. "async blocking msg handlers". async ones where we want the previous property, i.e. we want the `_message_loop` to wait until the handler finishes. We await the handler inside `process_message`, and `_message_loop` awaits `process_message`.
3. "async non-blocking msg handlers". async message handlers that can be spawned e.g. onto `Peer.taskgroup` and the loop is free to start processing subsequent messages. e.g. msg handlers that start a negotiation, such as `on_shutdown` and `on_open_channel`.

Any non-async message handler (`def on_...`) automatically goes into category 1.
An async message handler, by default, goes into category 2, "blocking";
to go into category 3 ("non-blocking"), we use the `runs_in_taskgroup` function decorator.
2024-02-15 11:20:49 +00:00
Sander van Grieken
643fbecc15 wizard: fix co-signing hardware wallets data incorrectly referenced 2024-02-14 12:42:15 +01:00
SomberNight
6172898a03 trezor: minor things for better model "safe 3" support 2024-02-14 09:48:13 +00: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
SomberNight
130baf13c8 trezor: show descriptive error if trying to init device without fw
closes https://github.com/spesmilo/electrum/issues/8892
2024-02-14 08:52:23 +00:00
SomberNight
46ce5d0f3d wizard: (trivial) follow-up prev 2024-02-13 14:52:52 +00:00
SomberNight
638fdf114e wizard: don't log sensitive values: replace blacklist with whitelist
- blacklist was missing yet another item "multisig_master_pubkey"
- let's just do a whitelist. a blacklist is too risky for my liking here.
2024-02-13 13:51:53 +00:00
SomberNight
7cf22d4b9f coldcard: wallet info dlg: fix missing "Export for Coldcard" btn
regression from 711a325085

```
 47.97 | E | plugin | Plugin error. plugin: coldcard, hook: wallet_info_buttons
Traceback (most recent call last):
  File "...\electrum\electrum\plugin.py", line 261, in run_hook
    r = f(*args)
  File "...\electrum\electrum\plugins\hw_wallet\plugin.py", line 344, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\plugins\coldcard\qt.py", line 51, in wallet_info_buttons
    wallet = main_window.wallet
AttributeError: 'WalletInfoDialog' object has no attribute 'wallet'
```
2024-02-13 13:35:19 +00:00
Sander van Grieken
66af6e6239 send_tab: set tab changes focus for multiline edit
ref #8889
2024-02-13 13:00:11 +01:00
Sander van Grieken
b3bce0299f send_tab: fix tab order #8889 2024-02-13 12:49:08 +01:00
SomberNight
b3a908f647 WalletDB: (trivial) add type hint 2024-02-12 18:26:08 +00:00
Sander van Grieken
3582c79160 stub QVideoSink import as it requires many dependencies but isn't used on android currently 2024-02-12 11:49:43 +01:00
Sander van Grieken
71dbf76cd0 add new 'qml_gui' extra to setup.py and include it for tox 2024-02-12 11:29:05 +01:00
Sander van Grieken
46e0c6e8ae tests: print traceback of original exception when testcase fails 2024-02-12 10:38:40 +01:00
Sander van Grieken
08a06ae4aa don't prefix utility classes and functions file with test_ 2024-02-12 10:10:36 +01:00
SomberNight
b6e5fe8dbe lnworker: history to include close tx for channel backups
- scenario:
  - reuse same seed between two devices, LN enabled on both
  - open channel using device1, import chan backup on device2
  - local-force-close channel using device1
  - tx1 (ctx) gets into mempool (or even mined), tx2 (sweep tx for to_local) is a local (future) tx
  - history tab on device1 shows tx1 and tx2
  - history tab on device2 was showing only tx2, and no info about tx1
    - device2 knows about tx1, it was just not showing it previously.
      With this commit, tx1 is now shown in the history.
    - note: tx1 might linger in the mempool for an indeterminate amount of time, or even become local.
      During that time, it is confusing on device2 not to show any feedback. Also,
      if tx1 becomes local, it is useful to be able to rebroadcast it.
2024-02-12 02:01:14 +00:00
Sander van Grieken
058305acca add a simple test framework for testing QObjects and their signal/slot mechanism 2024-02-09 15:45:52 +01:00
SomberNight
a083b95021 util.CallbackManager: handle callbacks being cancelled
was getting log spam when running the pycharm debugger in certain cases:
```
  3.29 | E | concurrent.futures | exception calling callback for <Future at 0x1d4987bcc70 state=cancelled>
Traceback (most recent call last):
  File "...\Python310\lib\concurrent\futures\_base.py", line 342, in _invoke_callbacks
    callback(self)
  File "...\electrum\electrum\util.py", line 1785, in on_done
    if exc := fut_.exception():
  File "...\Python310\lib\concurrent\futures\_base.py", line 485, in exception
    raise CancelledError()
concurrent.futures._base.CancelledError
```
2024-02-09 13:48:51 +00:00
SomberNight
afb245c17d scripts: fix regression in quick_start.py
```
$ ./electrum/scripts/quick_start.py
Traceback (most recent call last):
  File "/home/user/wspace/electrum/./electrum/scripts/quick_start.py", line 32, in <module>
    wallet.start_network(network)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 620, in start_network
    assert self.network is None, "already started"
AssertionError: already started
```
just the sanity check added in 6ac3f84095
2024-02-08 23:44:08 +00:00
Sander van Grieken
7725e88e32 tests: payment_identifier: check multiline output amounts
implicit conversion check via config.decimal_point
2024-02-08 14:06:25 +01:00
Sander van Grieken
6dd1cf0dba tests: payment_identifier: remove redundant, add some less common domain names 2024-02-08 13:55:35 +01:00
Sander van Grieken
fa46b4633f tests: payment_identifier: check multiline outputs exist, are correct number and type 2024-02-08 13:51:42 +01:00
Sander van Grieken
499b8ed375 tests: payment_identifier: add some more whitespace situations, fix script spk 2024-02-08 13:45:46 +01:00
Sander van Grieken
73be52203b tests: add tests for all supported payment identifier types.
resolve and finalize phases still TODO
2024-02-08 13:35:49 +01:00
Sander van Grieken
2dd4195ad8 qt: ChoiceWidget fix init selected_key 2024-02-08 11:42:14 +01:00
Sander van Grieken
6738e1e90f p4a: python-for-android ref 4f1a1a3a41f6bf8d28984bfd1ec8af3c5d8eb362
> qt6: replace synchronizedList with explicit synchronize block, as we still see ConcurrentModificationExceptions
  in the play store.
2024-02-07 12:08:10 +01:00
SomberNight
1736558e3d type hints: follow-up prevprev. "union types as X | Y" needs py3.10
https://peps.python.org/pep-0604/
2024-02-07 11:03:55 +00:00