Commit Graph

7074 Commits

Author SHA1 Message Date
SomberNight
5ba156fcad Merge remote-tracking branch 'remotes/accumulator/qt6'
For the "qml" gui (used on Android), this upgrades the qt version from 5.15 to 6.4.

PR https://github.com/spesmilo/electrum/pull/8545
2023-11-09 16:18:56 +00:00
Sander van Grieken
047cc6f957 qml: remove attempt to unfocus by clicking dialog background
Doesn't really work as it triggers on events above the background it is defined on :(
2023-11-08 15:38:26 +01:00
Sander van Grieken
8798a45d70 qml: fix issue with width of fiat textedit on ReceiveDetailsDialog 2023-11-07 17:05:13 +01:00
Sander van Grieken
f708e7f03e wizard/wallet: clean up imports, code style warnings. 2023-11-07 11:05:30 +01:00
Sander van Grieken
a6432732f0 qml: addresses/coins filter match case insensitive, don't match 'None' for undefined fields 2023-11-07 10:47:34 +01:00
SomberNight
1544a71542 qml qr scanner: make xml layout look nicer 2023-11-07 10:32:14 +01:00
Sander van Grieken
11d39cd942 qml: fix keyboard exclusion zone
turns out that Qt.inputMethod.keyboardRectangle.height is not suitable for calculating the exact keyboard
dimensions in Qt coordinates. Instead, use Qt.inputMethod.keyboardRectangle.y transformed to Qt coordinates
using Screen.devicePixelRatio

Note: Qt.inputMethod.keyboardRectangle stop being updated after exiting FLAG_SECURE state
(e.g. in seed or master key entry pages)
2023-11-07 10:32:00 +01:00
Sander van Grieken
32c1915de4 qml: restore Send/ScanDialog for desktop/dev, keeping qr scan Activity for android only.
Also use stable R package, regardless of APP_PACKAGE_DOMAIN used in build.
2023-11-07 10:17:10 +01:00
SomberNight
5c3e14d8de qml: replace Send/ScanDialog with java bases zxing qr scan activity. 2023-11-07 10:17:10 +01:00
SomberNight
c33ee87544 android: restore SimpleScannerActivity.java that was used in kivy
for QR code scanning with camera

1c10b1ce00/electrum/gui/kivy/data/java-classes/org/electrum/qr/SimpleScannerActivity.java
2023-11-07 10:17:10 +01:00
Sander van Grieken
be801f30e8 gui: make common_qt compatible with both Qt5 and Qt6 2023-11-07 10:17:10 +01:00
Sander van Grieken
db532dbd19 qml: android back-gesture conflict hack not working on qt6, replace with simple properties 2023-11-07 10:17:10 +01:00
Sander van Grieken
a77ff9943a qml: refactor qr scan to qt6
As the method of capturing frames is totally different, the animation when
a QR is found has been removed.
2023-11-07 10:17:10 +01:00
Sander van Grieken
65d41ccc49 qml: qualify all signal handler parameters 2023-11-07 10:17:10 +01:00
Sander van Grieken
ae446377f8 qml: work around toolbar layout not right-aligning indicators when indicators toggle visibility 2023-11-07 10:17:10 +01:00
Sander van Grieken
8b567ae447 qml: remove all QML imports version numbers 2023-11-07 10:17:08 +01:00
Sander van Grieken
6270eae5c9 qml: port PyQt5 to PyQt6 2023-11-07 10:16:18 +01:00
SomberNight
7c2131209f config: handle better if data dir disappears while we are running
related https://github.com/spesmilo/electrum/issues/4151#issuecomment-1791117301

closes https://github.com/spesmilo/electrum/issues/4151
2023-11-02 16:59:53 +00:00
Sander van Grieken
d6a6f56ddf qml: add ice crystal icon and use for (un)freeze buttons. 2023-11-02 13:06:48 +01:00
Sander van Grieken
4671c002c9 qt: fix detected account select (#8673) 2023-11-02 12:49:31 +01:00
ThomasV
e8f5aa50ca Merge pull request #8653 from accumulator/addresses_coins_filter
qml: also show coins in Addresses page, and add a few filter options.…
2023-11-02 12:36:24 +01:00
Sander van Grieken
6ce8a583fd qt: add missing case for on-chain fallback for BIP21 payment identfier containing lightning invoice 2023-11-02 10:24:37 +01:00
SomberNight
ccbac96f9a (trivial) contacts: add some type hints 2023-11-01 17:35:45 +00:00
SomberNight
511674a532 contacts: fix adding new contacts
This is a regression from 7ca89f56ee, which introduced StoredList.
The newly added test was failing without the change.

```
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1786, in new_contact_dialog
    self.set_contact(line2.text(), line1.text())
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1435, in set_contact
    self.contacts[address] = ('address', label)
  File "/home/user/wspace/electrum/electrum/contacts.py", line 75, in __setitem__
    self.save()
  File "/home/user/wspace/electrum/electrum/contacts.py", line 62, in save
    self.db.put('contacts', dict(self))
  File "/home/user/wspace/electrum/electrum/json_db.py", line 42, in wrapper
    return func(self, *args, **kwargs)
  File "/home/user/wspace/electrum/electrum/json_db.py", line 318, in put
    self.data[key] = copy.deepcopy(value)
  File "/usr/lib/python3.10/copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.10/copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.10/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.10/copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.10/copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.10/copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.10/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.10/copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.10/copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.10/copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.10/copy.py", line 161, in deepcopy
    rv = reductor(4)
TypeError: cannot pickle '_thread.RLock' object
```
2023-11-01 17:28:29 +00:00
Sander van Grieken
c694415b4b qml: add addresslist filter persistence 2023-11-01 18:23:16 +01:00
Sander van Grieken
e88cf0a683 qml: addresses list formatting, add txid/outpoint and amount to filter 2023-11-01 17:17:16 +01:00
Sander van Grieken
cf91d2e5cc qml: also show coins in Addresses page, and add a few filter options. Additionally, long press
now activates multi-select mode, and add action to (un)freeze selection.
2023-11-01 14:32:38 +01:00
Sander van Grieken
ec8500bd55 payment_identifier: if a bip21 uri contains a lightning invoice without fallback address,
and an address is present in the bip21 uri path, register the on-chain address in the
Invoice.outputs field to allow paying onchain from a saved Invoice later (when the PI
is unavailable). Fixes #8654
2023-11-01 12:47:28 +01:00
Sander van Grieken
af61b9d86b qml: also add share option for fallback address in InvoiceDialog 2023-11-01 11:38:47 +01:00
Sander van Grieken
6c51927576 qml: emit error when bip21 contains neither an address nor a lightning invoice (fixes #8662) 2023-11-01 02:54:19 +01:00
SomberNight
711a325085 main_window: split out "walet info" dlg into separate file
- no semantic changes, only moving code
- the change in qt/util.py is to avoid GC issues
  - due to moving code, the group was moving out of scope and getting GC-ed,
    as we only keep a reference to the vbox

(idea from 263fb2ba33 )
2023-10-31 17:41:11 +00:00
SomberNight
3060372894 qt wizard: WCHaveMasterKey: use check_multisig_constraints
These checks were missing from validation. e.g. duplicate master keys were allowed.
2023-10-31 17:43:15 +01:00
SomberNight
4b2d8f062c qt wizard: fix WCHaveMasterKey for first multisig cosigner
fixes https://github.com/spesmilo/electrum/issues/8665
2023-10-31 17:43:15 +01:00
SomberNight
7df057aaf9 qt wizard: simplify WCHaveSeed 2023-10-31 17:43:15 +01:00
JeremyRand
a7f0c90c8a Add pow_hash_header abstraction (#7592)
There is no reason why the hash function for identifying a block and the
hash function used to instantiate Hashcash must be the same; it's only a
coincidence that Bitcoin happens to use the same hash for both use
cases.  Reflecting this fact by adding this abstraction makes the code
more flexible.

Co-authored-by: Jeremy Rand <jeremyrand@danwin1210.de>
2023-10-31 14:02:20 +00:00
SomberNight
564b6c29b7 wizard: fix self._logger vs self.logger
AttributeError: 'QENewWalletWizard' object has no attribute 'logger'
2023-10-30 18:16:00 +00:00
SomberNight
da8e6c2fbf wallet: check that multisig wallet does not have duplicate masterkeys
The wizard should technically disallows this at creation time,
but this second layer sanity check could not hurt.
Also, looks like the wizard check is not working properly atm
(regression from qt wizard refactor).
2023-10-30 17:22:08 +00:00
ThomasV
120faa480e If trampoline is enabled, do not add non-trampoline nodes to invoices
Rationale: The sender should not assume that they share the same list of
hardcoded trampolines as the receiver.
2023-10-29 16:21:25 +01:00
Sander van Grieken
4d60432064 qml: add share option for address in InvoiceDialog 2023-10-29 12:33:25 +01:00
ThomasV
1170927e6b Change the constructor of LNWorker, passing node_keypair instead of xprv.
There is no need for payment_secret_key and backup_key in this class
2023-10-27 18:28:36 +02:00
SomberNight
6506abf583 lnworker: use PaymentFeeBudget
- introduce PaymentFeeBudget, which contains limits for fee budget and cltv budget
  - when splitting a payment,
    - the fee budget is linearly distributed between the parts
      - this resolves a FIXME in lnrouter ("FIXME in case of MPP")
    - the cltv budget is simply copied
  - we could also add other kinds of budgets later, e.g. for the num in-flight htlcs
- resolves TODO in lnworker ("todo: compare to the fee of the actual route we found")
2023-10-27 16:01:23 +00:00
SomberNight
53a8453e3b trampoline: fix off-by-one confusion of fees
The convention is that edges (start_node -> edge_node) store
the policy/fees for the *start_node*.
This is what the non-trampoline edges were already using (for a long time),
but the trampoline ones were off-by-one (policy was for end_node),
which was then worked around in multiple places, to correct for...

i.e. I think because of all the workarounds, there was no actual bug,
but it was just very confusing.

Also note that the prior usage of trampoline edges would not work if
we (sender) were not directly connected to a TF (trampoline-forwarder)
but had extra edges in the route to even get to the first TF.
Having the policy corresponding to the start_node of the edge would work
even in that case.
2023-10-27 14:24:19 +00:00
SomberNight
097a10f84d qt: window.how_lightning_invoice: routing_e should be read-only 2023-10-27 14:24:16 +00:00
SomberNight
39ef1cd4b9 mpp_split: make SplitConfig a subclass of dict, not just a type-hint 2023-10-27 14:24:12 +00:00
ThomasV
4a6c55ef7b test_lnpeer: add more tests, combining forwarding and hold invoices 2023-10-27 16:09:56 +02:00
SomberNight
0b25e593d5 lnworker.get_channel_by_short_id: give priority to real SCIDs
always check real SCIDs first, before checking aliases
2023-10-26 14:32:36 +00:00
ThomasV
fac5153329 Merge pull request #8659 from accumulator/issue_8658
request: amount_msat is set to None in Request when creating request …
2023-10-25 17:55:39 +02:00
SomberNight
abe700167f qt send tab: HelpLabel for "pay to" field: update text
- maybe make it more readable
- mention new syntax for raw scripts
  - see 3ff588049e
2023-10-24 16:47:05 +00:00
SomberNight
bb76b836a3 addr_sync.receive_tx_callback: rm redundant tx_hash arg 2023-10-24 16:07:30 +00:00
ThomasV
fce83c708c fail_swap: do not remove swap if it has been funded 2023-10-24 17:25:53 +02:00