1
0
Commit Graph

2890 Commits

Author SHA1 Message Date
Sander van Grieken
30abcad999 payment_identifier: move amount_range into payment_identifier 2023-06-28 16:49:28 +02:00
Sander van Grieken
49dab82efa send_tab: add spinner for network lookup indication 2023-06-28 16:49:28 +02:00
Sander van Grieken
febb2222d4 send_tab: simplify lock_max 2023-06-28 16:49:28 +02:00
Sander van Grieken
3df13b8ce4 qt: disallow save of LNURLp/LnAddr 2023-06-28 16:49:28 +02:00
Sander van Grieken
6b57743c3e send_tab: add LNURLp range as tooltip on amount field 2023-06-28 16:49:28 +02:00
Sander van Grieken
fbb37d6fae payment_identifier: add DOMAINLIKE payment identifier type, support domainlike -> openalias 2023-06-28 16:49:28 +02:00
Sander van Grieken
0cbf403f8b use NamedTuple for payment identifier gui fields 2023-06-28 16:49:28 +02:00
Sander van Grieken
3a1e5244b8 qt: fix enable/disable max button for openalias and restrict openalias to address only 2023-06-28 16:49:28 +02:00
Sander van Grieken
eed016bd7e qt: move setting frozen styling to edit components themselves, fix re-enabling Clear button after finalize 2023-06-28 16:49:28 +02:00
Sander van Grieken
ca283a75d0 qml: exclude non-address SPK from supported payment identifiers 2023-06-28 16:49:28 +02:00
Sander van Grieken
74a1f38a8b payment identifier types as enum 2023-06-28 16:49:28 +02:00
Sander van Grieken
fc141c0182 payment_identfier: refactor qml and tests 2023-06-28 16:49:28 +02:00
Sander van Grieken
915f66c0b8 payment_identifier: fix emaillike
qt: validate on pushback timer, buttons enable/disable, cleanup
2023-06-28 16:49:28 +02:00
Sander van Grieken
bde066f9ce qt: refactor send_tab, paytoedit 2023-06-28 16:49:28 +02:00
Sander van Grieken
d9a43fa6ed refactor last callback, signals. remove timered validate, don't add invalid address/amount to outputs 2023-06-28 16:49:28 +02:00
Sander van Grieken
b1925f8747 payment_identifier: refactor round_3 to need_merchant_notify/notify_merchant 2023-06-28 16:49:28 +02:00
Sander van Grieken
7601726d29 payment_identifier: refactor round_2 to need_finalize/finalize stage 2023-06-28 16:49:28 +02:00
Sander van Grieken
508d1038d3 payment_identifier: define states, refactor round_1 into resolve stage 2023-06-28 16:49:28 +02:00
Sander van Grieken
a2ca191de1 pass wallet to PaymentIdentifier instead of config and contacts 2023-06-28 16:49:28 +02:00
Sander van Grieken
cbd388c297 fix flake8 issues (undefined references) 2023-06-28 16:49:28 +02:00
ThomasV
15eb765eac payment_identifiers:
- this separates GUI from core handling
 - the PaymentIdentifier class handles network requests
 - the GUI is agnostic about the type of PI
2023-06-28 16:49:28 +02:00
Sander van Grieken
d83149f668 qml: add workaround for android predictive back gestures in History component
contributes to #8464
2023-06-28 16:14:05 +02:00
SomberNight
c85139009a qt chan details dlg: make some more labels selectable 2023-06-23 20:02:25 +00:00
SomberNight
ca93af2b8a ln: some clean-up for option_scid_alias
- qt chan details dlg: show both local and remote aliases
- lnchannel: more descriptive names, add clarification in doctstrings,
  and also save the "local_scid_alias" in the wallet file (to remember if
  we sent it)
- lnpeer:
  - resend channel_ready msg after reestablish, to upgrade old existing channels
    to having local_scid_alias
  - forwarding bugfix, to follow BOLT-04:
    > - if it returns a `channel_update`:
    >   - MUST set `short_channel_id` to the `short_channel_id` used by the incoming onion.
2023-06-23 19:51:57 +00:00
SomberNight
888291a8f8 qml: fix lnurl-pay when config.BTC_AMOUNTS_ADD_THOUSANDS_SEP is True
when paying an lnurl-pay that provides an amount interval,
the amount field is editable by the user and it expects no spaces
2023-06-23 16:23:12 +00:00
gruve-p
fbf41b582a kivy: fix fx history rates 2023-06-20 09:28:13 +02:00
SomberNight
23f2412da7 qt: follow-up "rm thousand sep when copying numbers to clipboard"
follow-up https://github.com/spesmilo/electrum/pull/8479
2023-06-13 15:59:18 +00:00
ThomasV
5b5100eedc Merge pull request #8479 from thomasleveil/feat_copy_numbers
 remove thousand separator when copying numbers to clipboard
2023-06-13 14:40:17 +02:00
Thomas LÉVEIL
1b07472805 🐛 fix #8469 - fiat balance sorting (#8478)
in address list window
2023-06-12 22:39:31 +00:00
Thomas
cdab59f620 remove thousand separator when copying numbers to clipboard
from contextual menus
2023-06-11 23:55:10 +02:00
Sander van Grieken
8cd95f1f7f qml: limit BIP39 cosigners script type to initial choice (bip39) or initial seed (electrum) 2023-06-02 09:46:53 +02:00
SomberNight
1c0ba83d10 (trivial) qt wizard: add title to seed options dialog window 2023-05-31 10:58:54 +00:00
Sander van Grieken
6fbe765a3e qml: make ConfirmTxDialog flickable if content larger than window (fixes #8446) 2023-05-31 11:29:14 +02:00
SomberNight
328a2bb3f2 config: migrate qt gui optional tabs to config vars 2023-05-30 14:04:20 +00:00
SomberNight
24980feab7 config: introduce ConfigVars
A new config API is introduced, and ~all of the codebase is adapted to it.
The old API is kept but mainly only for dynamic usage where its extra flexibility is needed.

Using examples, the old config API looked this:
```
>>> config.get("request_expiry", 86400)
604800
>>> config.set_key("request_expiry", 86400)
>>>
```

The new config API instead:
```
>>> config.WALLET_PAYREQ_EXPIRY_SECONDS
604800
>>> config.WALLET_PAYREQ_EXPIRY_SECONDS = 86400
>>>
```

The old API operated on arbitrary string keys, the new one uses
a static ~enum-like list of variables.

With the new API:
- there is a single centralised list of config variables, as opposed to
  these being scattered all over
- no more duplication of default values (in the getters)
- there is now some (minimal for now) type-validation/conversion for
  the config values

closes https://github.com/spesmilo/electrum/pull/5640
closes https://github.com/spesmilo/electrum/pull/5649

Note: there is yet a third API added here, for certain niche/abstract use-cases,
where we need a reference to the config variable itself.
It should only be used when needed:
```
>>> var = config.cv.WALLET_PAYREQ_EXPIRY_SECONDS
>>> var
<ConfigVarWithConfig key='request_expiry'>
>>> var.get()
604800
>>> var.set(3600)
>>> var.get_default_value()
86400
>>> var.is_set()
True
>>> var.is_modifiable()
True
```
2023-05-25 17:39:48 +00:00
SomberNight
03ab33f4b2 SimpleConfig: change API of set_key(): "save" is now kwarg-only 2023-05-25 17:37:16 +00:00
SomberNight
e9475345e4 qml wizard: "confirm seed" screen to normalize whitespaces
fixes https://github.com/spesmilo/electrum/issues/8442
2023-05-17 15:19:41 +00:00
SomberNight
fc7c5dde6e qt SwapDialog: propagate errors from _create_tx
fixes https://github.com/spesmilo/electrum/issues/8430
2023-05-16 14:41:26 +00:00
Sander van Grieken
1dd129c3e8 qml: remove logging ElCombobox 2023-05-15 16:51:49 +02:00
Sander van Grieken
5881eb3035 qml: LnurlPayRequestDialog validate amount between indicated boundaries 2023-05-15 16:47:19 +02:00
Sander van Grieken
229afdd887 qml: styling LnurlPayRequestDialog 2023-05-15 16:47:06 +02:00
Sander van Grieken
8d0fa27065 qml: remove unnecessary assert (#8420) 2023-05-15 16:45:15 +02:00
Sander van Grieken
4f252a438c qml: validate duplicate master key in WCBIP39Refine for BIP39 cosigner seeds (fixes #8432) 2023-05-15 14:45:21 +02:00
Sander van Grieken
cb13eee8a3 qml: let ElCombobox determine implicitWidth based on the dimensions of all modelitems 2023-05-15 13:43:57 +02:00
Sander van Grieken
04c9078955 qml: show pay_invoice error to user 2023-05-15 11:56:40 +02:00
Sander van Grieken
3115ce2f53 qml: show historic fiat amounts when enabled and applicable 2023-05-15 11:38:43 +02:00
Sander van Grieken
89225a9f41 qml: show result dialog after password change 2023-05-12 10:53:02 +02:00
ThomasV
ca49d73312 Merge pull request #8417 from SomberNight/202305_db_version_52
wallet_db version 52: break non-homogeneous multisig wallets
2023-05-11 16:35:42 +02:00
SomberNight
68fb996d20 wallet_db version 52: break non-homogeneous multisig wallets
- case 1: in version 4.4.1, 4.4.2, the qml GUI wizard allowed creating multisig wallets with an old_mpk as cosigner.
- case 2: in version 4.4.0, 4.4.1, 4.4.2, the qml GUI wizard allowed creating multisig wallets with mixed xpub/Ypub/Zpub.

The corresponding missing input validation was a bug in the wizard, it was unintended behaviour. Validation was added in d2cf21fc2b. Note however that there might be users who created such wallet files.

Re case 1 wallet files: there is no version of Electrum that allows spending from such a wallet. Coins received at addresses are not burned, however it is technically challenging to spend them. (unless the multisig can spend without needing the old_mpk cosigner in the quorum).

Re case 2 wallet files: it is possible to create a corresponding spending wallet for such a multisig, however it is a bit tricky. The script type for the addresses in such a heterogeneous xpub wallet is based on the xpub_type of the first keystore. So e.g. given a wallet file [Yprv1, Zpub2] it will have sh(wsh()) scripts, and the cosigner should create a wallet file [Ypub1, Zprv2] (same order).

Technically case 2 wallet files could be "fixed" automatically by converting the xpub types as part of a wallet_db upgrade. However if the wallet files also contain seeds, those cannot be converted ("standard" vs "segwit" electrum seed).
Case 1 wallet files are not possible to "fix" automatically as the cosigner using the old_mpk is not bip32 based.

It is unclear if there are *any* users out there affected by this. I suspect for case 1 it is very likely there are none (not many people have pre-2.0 electrum seeds which were never supported as part of a multisig who would also now try to create a multisig using them); for case 2 however there might be.

This commit breaks both case 1 and case 2 wallets: these wallet files can no longer be opened in new Electrum, an error message is shown and the crash reporter opens. If any potential users opt to send crash reports, at least we will know they exist and can help them recover.
2023-05-11 14:26:11 +00:00
Sander van Grieken
f8ce6c6564 qml: small screen fixes 2023-05-11 13:24:54 +02:00