Commit Graph

16339 Commits

Author SHA1 Message Date
SomberNight 7f52415807 util: add some logging to NetworkJobOnDefaultServer starting/stopping
to help debug claims of Synchronizer maybe getting stuck
2023-05-02 13:41:47 +00:00
Sander van Grieken 0672ea20ab qml: implement toggle for android SECURE_FLAG and add marker to wizard pages
that should be secured.
2023-05-02 15:16:51 +02:00
ThomasV 8a25d59ba6 wallet: save num_parents of utxos in wallet file.
fixes #8361
2023-05-02 09:27:39 +02:00
ThomasV 6d392a67f9 wallet.get_tx_parents: populate cache regardless of self.is_up_to_date()
Fixes #8315
2023-05-02 09:11:21 +02:00
Sander van Grieken 5600375d51 qml: no auto caps on import and master key controls 2023-04-29 14:30:25 +02:00
Sander van Grieken 56165c3790 qml: don't start loadWallet if daemon is busy loading. 2023-04-29 14:13:12 +02:00
Sander van Grieken 1b362f64f2 qml: properly delete wizard components after use. fixes #8357 2023-04-29 13:57:16 +02:00
Sander van Grieken db53b0f573 qml: fix 2fa callback issue #8368 2023-04-29 12:05:25 +02:00
SomberNight 155258f208 release.sh: check we have each binary (RM case)
~duplicated from the non-RM case
2023-04-27 17:36:09 +00:00
SomberNight 22b8c4e397 hww: fix digitalbitbox(1) support
regression from cea4238b81

```
975.04 | E | plugin.DeviceMgr | failed to create client for digitalbitbox at <REDACTED>: AttributeError("'NoneType' object has no attribute 'get_passphrase'")
Traceback (most recent call last):
  File "...\electrum\electrum\plugin.py", line 620, in list_pairable_device_infos
    soft_device_id = client.get_soft_device_id()
  File "...\electrum\electrum\plugins\hw_wallet\plugin.py", line 251, in get_soft_device_id
    root_fp = self.request_root_fingerprint_from_device()
  File "...\electrum\electrum\plugin.py", line 362, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "...\electrum\electrum\plugin.py", line 352, in run_in_hwd_thread
    return func()
  File "...\electrum\electrum\plugins\hw_wallet\plugin.py", line 264, in request_root_fingerprint_from_device
    child_of_root_xpub = self.get_xpub("m/0'", xtype='standard')
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 115, in get_xpub
    reply = self._get_xpub(bip32_path)
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 110, in _get_xpub
    if self.check_device_dialog():
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 197, in check_device_dialog
    if not self.password_dialog(msg):
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 159, in password_dialog
    password = self.handler.get_passphrase(msg, False)
AttributeError: 'NoneType' object has no attribute 'get_passphrase'
```
2023-04-27 17:33:54 +00:00
SomberNight 499f51535f bip32: fix hardened char "h" vs "'" compatibility for some hw wallets
in particular, ledger: fix sign_message for some wallets

```
156.02 | E | plugins.ledger.ledger |
Traceback (most recent call last):
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 1265, in sign_message
    result = base64.b64decode(self.client.sign_message(message, address_path))
  File "...\Python310\site-packages\ledger_bitcoin\client.py", line 230, in sign_message
    sw, response = self._make_request(self.builder.sign_message(message_bytes, bip32_path), client_intepreter)
  File "...\Python310\site-packages\ledger_bitcoin\command_builder.py", line 176, in sign_message
    bip32_path: List[bytes] = bip32_path_from_string(bip32_path)
  File "...\Python310\site-packages\ledger_bitcoin\common.py", line 68, in bip32_path_from_string
    return [int(p).to_bytes(4, byteorder="big") if "'" not in p
  File "...\Python310\site-packages\ledger_bitcoin\common.py", line 68, in <listcomp>
    return [int(p).to_bytes(4, byteorder="big") if "'" not in p
ValueError: invalid literal for int() with base 10: '84h'
```

Regression from df2bd61de6, where the
default hardened char was changed from "'" to "h". Note that there was
no corresponding wallet db upgrade, so some files use one char and
others use the other.
2023-04-27 17:03:16 +00:00
SomberNight 9e1bb940ac prepare release 4.4.1 2023-04-27 11:11:29 +00:00
SomberNight 4416f73592 update locale submodule 2023-04-27 11:08:05 +00:00
SomberNight f5f177f7e8 qml wizard: fix restoring from old mpk (watchonly for "old" seeds)
fixes https://github.com/spesmilo/electrum/issues/8356
2023-04-27 09:34:23 +00:00
SomberNight 87909485c5 qml: wizard to check if wallet name is already used
was erroring at the very last moment previously
2023-04-27 08:47:02 +00:00
SomberNight 57ae933582 (trivial) add some type hints to wallet.get_tx_parents 2023-04-26 18:11:55 +00:00
ghost43 ac7a9c3642 Merge pull request #8329 from SomberNight/202304_secp_debian
README: refer to `libsecp256k1-dev` instead of `libsecp256k1-0`
2023-04-26 17:02:17 +00:00
SomberNight 910832c153 transaction: calc and cache TxInput/TxOutput.address on-demand
In one wallet, before this, make_unsigned_transaction() took 120 sec,
now it takes ~8 sec.

hot path:
```
make_unsigned_transaction (electrum/wallet.py:1696)
add_input_info (electrum/wallet.py:2261)
utxo (electrum/transaction.py:289)
tx_from_any (electrum/transaction.py:1232)
deserialize (electrum/transaction.py:805)
<listcomp> (electrum/transaction.py:805)
parse_output (electrum/transaction.py:706)
__init__ (electrum/transaction.py:127)
scriptpubkey (electrum/transaction.py:173)
get_address_from_output_script (electrum/transaction.py:672)
```
2023-04-26 16:54:13 +00:00
ThomasV 8dca907891 get_tx_parent: populate cache in chronological order 2023-04-26 18:29:46 +02:00
SomberNight ad5f95cb87 util.profiler: add "min_threshold" arg 2023-04-26 14:49:37 +00:00
SomberNight ee52154542 transaction: TxInput: store addr/spk/value_sats, instead of re-calc
We were re-calculating txin.address from the prevtx-utxo on every call,
e.g. in electrum/gui/qt/utxo_list.py#L103 (for every utxo in the wallet).

For a wallet with ~1300 utxos, UTXOList.update() took ~3.2 sec before this,
now it's ~0.8 sec.
2023-04-26 13:08:27 +00:00
SomberNight 312e50e9a9 qml: send screen: bip21: fallback to onchain addr if no LN channels
given a bip21 uri that has both onchain addr and bolt11,
if we have LN enabled but no LN channels, auto-fallback to paying onchain

we will have to clean up and unify this logic between GUIs. becoming spaghetti :/
rumour has it, Thomas has a branch? :P
2023-04-25 22:23:24 +00:00
SomberNight 5b122e723f follow-up prev: re-add some newlines 2023-04-25 18:19:19 +00:00
SomberNight 55140a9e27 gui/messages.py: allow localization of these strings 2023-04-25 17:54:07 +00:00
Sander van Grieken 663ea431f6 followup 61179ede8c 2023-04-25 14:22:19 +02:00
Sander van Grieken a23457f48d qml: consistency camelcase pyqtProperties 2023-04-25 14:15:13 +02:00
Sander van Grieken e26d49f11e qml: consistency camelcase public slots qetxdetails, qelnpaymentdetails, qechannelopener, qeaddressdetails 2023-04-25 13:46:30 +02:00
Sander van Grieken 264540e12b qml: consistency camelcase public slots qedaemon, qeinvoice, qewizard 2023-04-25 13:40:16 +02:00
Sander van Grieken 61179ede8c qml: consistency camelcase qewallet 2023-04-25 13:33:15 +02:00
Sander van Grieken f0bbbe9955 qml: consistency camelcase public slots listmodels 2023-04-25 13:22:34 +02:00
Sander van Grieken 2b091b283a qml: qebitcoin remove unused code, fix scoping, camelcase 2023-04-25 13:04:09 +02:00
Sander van Grieken 96fd339a52 qml: followup 22fa84a0, use fixed font, use camelcase for QML properties 2023-04-25 12:46:30 +02:00
ghost43 664544886a Merge pull request #8318 from SomberNight/202304_qt_bumpfee
qt bump fee: disallow targeting an abs fee. only allow setting feerate
2023-04-24 16:56:53 +00:00
SomberNight 22fa84a0d5 qml: ReceiveDialog: clicking QR code to show encoded text
closes https://github.com/spesmilo/electrum/issues/8331
2023-04-24 16:53:20 +00:00
SomberNight adf976fef4 qml: QERequestDetails: use uppercase in bolt11 QR code
same trick as in other GUIs
2023-04-24 16:21:26 +00:00
SomberNight bf41675d4c qml: invoice/request list: flip sort order: newest on top
to be consistent with the History, and with other GUIs

(the model is the easiest place to do it. QSortFilterProxyModel/etc looks overkill)
2023-04-24 15:33:10 +00:00
Sander van Grieken 407769cb5f qml: remove Scan.qml 2023-04-24 17:32:13 +02:00
Sander van Grieken 5ead4feabb qml: wallet menu wider to fit wide translated texts 2023-04-24 17:24:22 +02:00
SomberNight e097a3f875 CI: add some task dependencies
run linter first, then tests, then binary builds
2023-04-24 13:37:01 +00:00
ghost43 8ef395f4f3 Merge pull request #8337 from SomberNight/202304_flake8_bugbear
CI: flake8-bugbear
2023-04-24 13:27:54 +00:00
SomberNight 4cbb8399d2 CI: also run flake8-bugbear, as part of flake8 2023-04-24 13:00:12 +00:00
SomberNight 4219022c2e fix flake8-bugbear B023
B023 Function definition does not bind loop variable 'already_selected_buckets_value_sum'

in keepkey/qt.py, looks like this was an actual bug
(fixed in trezor plugin already: https://github.com/spesmilo/electrum/commit/52a4810752c37312aeb7cb4739b5462dfdde2c58 )
2023-04-24 13:00:07 +00:00
SomberNight 612d3493df fix flake8-bugbear B017
B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
2023-04-24 12:58:30 +00:00
SomberNight 90315e72d6 fix flake8-bugbear B016
B016 Cannot raise a literal. Did you intend to return it or raise an Exception?
2023-04-24 12:58:26 +00:00
SomberNight 8266ebcc46 fix flake8-bugbear B008
B008 Do not perform function calls in argument defaults.  The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call.  If this is intended, assign the function call to a module-level variable and use that variable as a default value.
2023-04-24 12:58:23 +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 6848b8f375 qml: refactor all custom QRScan component wrappers to ScanDialog
(except SendDialog, which has a Paste button and slightly different behavior)
2023-04-24 13:34:05 +02:00
Sander van Grieken 49df18c613 qml: add hint property to QRScan 2023-04-24 13:19:40 +02:00
Sander van Grieken 959d481e93 qml: create ScanDialog 2023-04-24 13:19:01 +02:00