Commit Graph

78 Commits

Author SHA1 Message Date
Sander van Grieken 49de400c27 2fa: fix #9312
(regression of 4a37668b01)
2024-11-19 09:13:27 +01:00
Sander van Grieken c6cd47ebba qml: refactor QEWallet.sign() to sign() and sign_and_broadcast(), add user feedback when signing fails. 2024-10-23 12:02:01 +02:00
Sander van Grieken 974ad64688 trustedcoin: clean up imports, flake warnings 2024-10-21 14:11:18 +02:00
Sander van Grieken 0d22994277 trustedcoin: fix check in 2fa wallet setup, when not continuing a unfinished wallet (fixes #9253) 2024-10-16 23:06:51 +02:00
Sander van Grieken 9e1c1bd0ad trustedcoin: fix continuation of 2fa wallet file with keystore-only encryption 2024-10-14 11:32:15 +02:00
ThomasV 3721f04ac8 replace electrum/ecc with electrum_ecc package 2024-10-10 15:46:00 +00:00
SomberNight 3d6198eff0 trustedcoin: Wallet_2fa.make_unsigned_transaction to use **kwargs
We often forget updating the method signature of Wallet_2fa.make_unsigned_transaction
when changing Abstract_Wallet.make_unsigned_transaction.
2024-06-17 16:55:23 +00:00
SomberNight 2eb51bcbe6 trustedcoin: sanitize error messages coming from 2fa server
related https://github.com/spesmilo/electrum/issues/9096
2024-06-17 16:52:26 +00:00
SomberNight 09e0413d38 trustedcoin: rm dead code (unused server method transfer_credit) 2024-06-17 14:44:42 +00:00
SomberNight 20d22d26b3 trustedcoin: rm dead code 2024-06-10 20:27:15 +00:00
SomberNight a2d5e31838 mnemonic: rename seed_type() fn
Some functions have an argument named "seed_type" in which it was annoying to call the seed_type() fn.
(especially for functions inside the same module)
2024-06-10 20:00:52 +00:00
SomberNight b4712397cc logging: (trivial) use repr() of seed_type
for more obvious empty string

related: https://github.com/spesmilo/electrum/issues/4326#issuecomment-1903747632
2024-02-22 11:45:18 +00:00
SomberNight 96f28607f2 keystore: "old"-type seeds cannot have a passphrase
related: https://github.com/spesmilo/electrum/pull/8906
2024-02-21 14:30:13 +00:00
SomberNight 7007a0c1c9 mnemonic: add type hints 2024-01-22 03:27:17 +00:00
Sander van Grieken ec81f00896 trustedcoin: cannot reset OTP when seed is not available (online wallet creation continuation) 2024-01-15 17:45:29 +01:00
ThomasV d6c45113e4 trustedcoin: do not db.write() from daemon thread. fixes #8791 2024-01-09 12:36:09 +01:00
Sander van Grieken 4c8287358a qt, qml: remove email entry from 2FA wallet ToS pages 2023-12-08 12:07:03 +01:00
ThomasV 0a732a0b52 trustedcoin: fix keystore name (follow-up 56e80c20d7) 2023-10-17 10:00:17 +02:00
ThomasV 56e80c20d7 wallet_db upgrade: do not use '/' in StoredDict keys 2023-09-23 11:05:36 +02:00
Sander van Grieken f69316d1a6 trustedcoin: remove old wizard code 2023-09-20 14:34:31 +02:00
Sander van Grieken 7080a7d8e2 qt: new wizard 2fa wallet online continuation from offline initial setup 2023-09-20 14:34:31 +02:00
Sander van Grieken 7a2633b2de flake happifier 2023-09-20 14:34:31 +02:00
Sander van Grieken 571d16314f qt: introduce electrum/gui/qt_common, implement remaining trustedcoin views,
unify most qml and qt wizard code for trustedcoin,
separate non-GUI trustedcoin wizard definition to trustedcoin.py
2023-09-20 14:34:31 +02:00
SomberNight 7482e275b9 follow-up storage/db changes
follow-up b96cc82333
2023-08-22 14:50:30 +00:00
ThomasV b96cc82333 Make storage a field of db
This comes from the jsonpatch_new branch.
I rather have in master now, because it touches a lot of filese.
2023-08-18 08:08:31 +02:00
SomberNight 87cba8bf32 trustedcoin: stricter client-side checks for 2fa fee 2023-06-13 16:52:50 +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 e2406f21b4 fix flake8-bugbear B011
B011 Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError().
2023-04-24 12:58:19 +00: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
Sander van Grieken 0c9d4abb82 qml: show 2FA status and billing info in WalletDetails, expose billing schedule setting in config 2022-11-04 13:35:15 +01:00
Sander van Grieken 43bac2edff qml: use new wizard approach in qml and also implement 2FA/trustedcoin 2022-10-21 13:31:24 +02:00
SomberNight 98feff07ad threading.Thread: fix some DeprecationWarnings
"DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead"
2022-05-23 17:52:39 +02:00
Andrew Kozlik 0dce13a1dd Implement SLIP-0039 wallet recovery. 2021-04-30 19:55:47 +02:00
ThomasV 2c39f0c9c4 fix #7190 2021-04-08 15:12:32 +02:00
ThomasV 774a9ad263 fix #7164 2021-04-01 14:42:52 +02:00
ThomasV 641968fcf8 Wizard: do not ask seed type, default to segwit
segwit addresses are widely supported today.
2021-01-12 11:03:21 +01:00
SomberNight d1302d3384 mnemonic: tighten seed_type check for old "2fa" type seeds
Seeds in the set difference could already not be restored: they raised
an exception in the wizard; now these are not recognised as valid seeds
anymore (so e.g. OK button in wizard will be disabled).
Also see comments in code.
2020-12-10 14:36:31 +01:00
SomberNight 933d8861ce mnemonic.make_seed: de-duplicate num_bits default magic number 2020-12-08 10:00:34 +01:00
ThomasV 427779350f Trustedcoin: call wizard.terminate with aborted set to True in various failure conditions (see #4496) 2020-11-29 11:43:33 +01:00
SomberNight 4a4b0922e5 trustedcoin: (trivial) add a stub method in plugin base class 2020-05-29 20:51:52 +02:00
SomberNight e6e587b7da trustedcoin: use psbt format on wire. rm psbt to legacy tx conversion.
closes #6123
2020-05-29 18:58:30 +02:00
ThomasV 9a462ac9b5 trustedcoin: fix wallet constructor 2020-02-20 20:59:18 +01:00
SomberNight 07f5d6b745 keystore: 'get_tx_derivations' no longer public 2020-02-12 18:14:00 +01: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
SomberNight c2b0039935 bitcoin.py: remove some remnants of TYPE_ADDRESS, TYPE_SCRIPT 2019-11-21 18:51:38 +01:00
SomberNight bafe8a2fff integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight 04edad9984 config: no longer singleton. it is passed to Wallet.__init__
The few other cases that used SimpleConfig.get_instance() now
either get passed a config instance, or they try to get a reference
to something else that has a reference to a config.
(see lnsweep, qt/qrcodewidget, qt/qrtextedit)
2019-09-22 20:46:01 +02:00
ThomasV 16e293c289 follow-up cefa4762ba 2019-09-10 16:24:21 +02:00
SomberNight 99b83f7527 fix #5617 2019-09-04 13:53:38 +02:00
SomberNight a42a773d19 storage: replace STO_EV_* ints with IntEnum 2019-09-04 13:31:49 +02:00