Adds unittest for Abstract_Wallet.export_history_to_file that
compares the output against reference files. This
should help to prevent regressions and ensure the layout
of the export stays static over time.
Change fees from sats to bitcoin so the fee value is consistent with the
other values.
Fixes#10445
Also adds a plugin hook so plugins can create fancy history exports.
And stops adding unconfirmed/local transactions to the history as they
are unordered and make the export non-deterministic. Also transactions
that haven't happened yet don't seem useful for accounting.
So it can be moved out of HistoryList, get unittested and potentially
used by QML too for example.
Also fix inconsistency between fiat_value and fees_fiat, sometimes if
fiat_value was `No Data` (value=None), fees_fiat was '0' as
fees_fiat.value was Decimal() instead of None.
When building on debian 12, we were using Java 17.
On debian 13, Java 17 is not packaged anymore, instead there is Java 21 and 25.
Ideally we should upgrade to Java 21 and just install it from apt.
However old Gradle is not compatible with new Java, so we have to upgrade Gradle for that.
- see https://docs.gradle.org/current/userguide/compatibility.html
Old Gradle is giving build errors with Java 21:
```
Could not compile build file '/home/user/wspace/electrum/.buildozer_qml/android/platform/build-arm64-v8a/dists/Electrum/build.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 65
java.lang.IllegalArgumentException: Unsupported class file major version 65
```
for our p4a fork, I tried to cherry-pick stuff from upstream:
- 17bf532279
- https://github.com/kivy/python-for-android/pull/3172a8f2ca1c5b
- see a01269f779...846a109487
That seems sufficient to upgrade Gradle as far as p4a is concerned.
However that still did not work yet:
- contrib/android/make_barcode_scanner.sh fails, as
markusfisch/zxing-cpp and markusfisch/CameraView
are also using too old gradle versions for Java 21
- it seems they are intentionally doing this to maintain compat with Android 4:
see d98ed5d0be
So for now maybe the path of least resistance is to downgrade to Java 17 :(
When gossip is enabled we waste a lot of time trying to connect
to onion peers if we don't have a proxy enabled. We should just skip
them and try to connect to clearnet peers instead.
LNPeerManager.add_peer would only check if self.network.proxy is set,
which it is always as Network is initialized with self.proxy =
ProxySettings(). Instead it should check if proxy is set and enabled.
Don't set the NETWORK_AUTO_CONNECT config if the user checked the custom
server config checkbox and then cancels the wizard, so the next time the
user starts the wizard they again will have the choice instead of
silently being forced into a random server.
Currently if the user cancels the wizard during the network config the
welcome component will already have set the NETWORK_AUTO_CONNECT config
to False (as the user selected the custom server checkbox), preventing
the wizard from starting again on the next startup.
Passes the default server (Network.default_server) to
Network.set_parameters instead of an empty string in
ServerConnectWizard.do_configure_server to avoid a traceback like in
I am not entirely sure how the user in #10437 managed to trigger
the exception as Network.set_parameters should already exit early at
`not self._was_started` in the Wizard as the network shouldn't have been
started yet during the wizard. However passing the default ServerAddr
instead of an empty string to set_parameters should avoid this
exception.
Same as Qt, validate the server address the user enters and prevent the
user from continuing in the wizard or clicking 'Ok' in the ServerConfig
if the entered address is clearly invalid.
The `ServerWidget` didn't validate the input of server_e, which allowed
the user to enter an invalid server connection string and exit the
dialog without knowing they entered an invalid string.
In the wizard this behavior is very misleading as the user explicitly
wanted to use a custom server, can click next after entering an invalid
server, and we will just silently fall back to automatic server selection.
This change will disable the "Next" button in the wizard if an invalid
address has been entered and show a red background in the server_e while
the input is not valid, so the user clearly sees that this input is not
going to be used.
This script used to work, I assume my breakage is due to the python version.
```
Traceback (most recent call last):
File "/home/user/wspace/electrum/./contrib/add_cosigner", line 35, in <module>
version_spec = importlib.util.spec_from_file_location('version', 'electrum/version.py')
^^^^^^^^^^^^^^
AttributeError: module 'importlib' has no attribute 'util'
```
Moves the logic requesting the forward swap into the TxEditor so it can
use the open transport and doesn't have to reconnect to the relays
again.
Also disables the "Preview" button in the TxEditor when the transaction will
send change to lightning.
This should prevent the user from saving the transaction to history and
broadcasting it later or exporting it and broadcasting it through some
external way.
Broadcasting needs to happen directly after the TxEditor so we can send
the second rpc call to the swapserver and await the incoming htlcs
before broadcasting the (funding-) transaction.
Update the TxEditor (onchain tab) if Send change to lightning is enabled
and the swap transport changes. Connect to swap transport if send change
to lightning gets enabled or if it is enabled and the TxEditor gets
opened.
This allows to nicely show the swap fees without blocking the UI to wait
until the swap manager gets initialized.
Check the swap providers liquidity as well if we try to send change to
lightning in `make_unsigned_transaction`. It is now expected that the
swap_manager is already initialized when calling
`make_unsigned_transaction`, otherwise no dummy output will get added.