53 Commits

Author SHA1 Message Date
Michael Mallan
16b96b5456
style: apply black formatting 2025-05-02 17:46:49 +01:00
edouardparis
61bc0ffbc8 tests: use data_directory 2025-04-23 18:53:56 +02:00
damuzhi0810
f12c65cdd2 chore: fix some comments
Signed-off-by: damuzhi0810 <rust@before.tech>
2025-01-23 22:05:18 +08:00
edouardparis
c14c55beee remove daemonize from config 2024-11-18 18:36:23 +01:00
pythcoiner
5c088b2eb6 tests: notifyAll() is deprecated, replace w/ notify_all() 2024-11-18 11:35:12 +01:00
Michael Mallan
c6add0aeb1
qa: add method to get lianad poll interval 2024-10-24 11:24:27 +01:00
Michael Mallan
537ebb2fb3
func test: check electrs has started 2024-09-10 14:19:48 +01:00
Antoine Poinsot
8b76a6b977
Merge #1269: Couple fixes to the functional tests
7cce13656266d90431133ccb4de5ccf086f4aa82 qa: test proc stderr isn't None before closing it (Antoine Poinsot)
ba553e9ddb104af454d9eff9969c0e37a1f3061a qa: adapt bitcoind config to support 28.0 (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  darosior:
    ACK 7cce13656266d90431133ccb4de5ccf086f4aa82

Tree-SHA512: ff0a9addd6063cd31b8e7f76cbf2b7ed1f5e85c2d7192ed5e73bba1c81a3bb4e8740ff7c5242d054115e28e484c87f85cafcbbc4dcc4ecf24ff415a028e1b0b5
2024-09-05 17:10:30 +02:00
Michael Mallan
341f940664
func test: prevent disconnects when using mocktime
Thanks to pythcoiner for providing this fix.
2024-09-05 14:56:01 +01:00
jp1ac4
371e31e3f3
func test: allow to run using electrs backend 2024-09-05 14:55:53 +01:00
jp1ac4
a85d4887e9
func test: allow for different bitcoin backends 2024-09-05 14:55:50 +01:00
Antoine Poinsot
7cce136562
qa: test proc stderr isn't None before closing it 2024-09-05 14:32:03 +02:00
Antoine Poinsot
ba553e9ddb
qa: adapt bitcoind config to support 28.0
Got broken by bca346a970
2024-09-05 14:31:01 +02:00
Antoine Poinsot
26ade7ebdd
qa: pipe stderr to stdout, not PIPE
It turns out that setting both to PIPE would result in stderr not being
read for some reason. So follow
https://docs.python.org/3/library/subprocess.html and set stdout to PIPE
and stderr to STDOUT.

Tested with a process (electrs) which logs on stderr.
2024-09-04 11:22:51 +02:00
jp1ac4
deb75884bf
tests: run black 2024-03-28 11:03:15 +00:00
Antoine Poinsot
ecef6bff5e
qa: functional tests lianad using Taproot descriptors
We introduce Taproot support in the test framework through a global
toggle. A few modifications are made to some tests to adapt them under
Taproot (notably the hardcoded fees / amounts).

This is based on my introduction of a quick and dirty support for
TapMiniscript in my python-bip380 library:
https://github.com/darosior/python-bip380/pull/23. In addition to this i
didn't want to implement a signer in the Python test suite so here we
introduce a simple Rust program based on our "hot signer" which will
sign a PSBT with an xpriv provided through its stdin and output the
signed PSBT on its stdout. Eventually it would be nicer to have a Python
signer instead of having to call a program.

The whole test suite should pass under both Taproot and P2WSH. Only a
single test is skipped for now under Taproot since it needs a finalizer
in the test suite.

I also caught a bug in the RBF tests which i fixed in place.
2024-03-13 19:21:52 +01:00
jp1ac4
1e7653e08a
tests: add function to wait while condition holds
This adds a new utils function that is a slight generalisation
of `wait_for` with an additional condition that must always be
met while waiting.

`wait_for` now calls this new function with the condition being
one that is always true.
2024-03-11 15:41:17 +00:00
Antoine Poinsot
bdf8b8f625
Rename IS_BITCOIND_25 to IS_NOT_BITCOIND_26
for f in ; do sed -i 's/IS_BITCOIND_25/IS_NOT_BITCOIND_24/g' tests/test_misc.py; done
2024-02-27 14:18:04 +01:00
jp1ac4
68b2503b12
func tests: move function to utils 2023-11-28 13:55:26 +00:00
jp1ac4
fdab722eff
func tests: run black 2023-11-28 13:55:25 +00:00
Antoine Poinsot
6f5b053ea5
Revert "Merge #742: commands: don't add derivation paths for keys from different path but same signer"
This reverts commit ec0c2426aa5fa6cee2efabd3ee6f175b41c35f64, reversing
changes made to 26d750d09c84734f56c2dc18cb332a232e24fb6d.

This reverts the fixes to the pruning of BIP32 derivation paths when
creating a PSBT, in preparation of reverting the merge of this feature
altogether. This is because always creating PSBT with only the BIP32
derivations for a single path broke the Ledger support.
2023-10-27 15:43:52 +02:00
Antoine Poinsot
cf33228b0d
qa: don't assume desc xpubs' der path length in finalizer
It's always 2 for now, but we are going to break this invariant. Make this code more robust.
2023-10-24 16:14:41 +02:00
Antoine Poinsot
5c87937d46
Add more bitcoind-related setup logging
At startup it sometimes appear we may be hanging when setting up
bitcoind. Add more loading to give more information about what's taking
long to setup (for instance, loading the watchonly wallet).
2023-08-14 10:29:33 +02:00
Antoine Poinsot
0f6fc48e88
qa: only run the RPC retry functional test with bitcoind 25.0 2023-08-09 15:50:22 +02:00
Antoine Poinsot
b96db71a4d
qa: bitcoind: add a helper for sending a P2P message to bitcoind 2023-08-09 12:55:58 +02:00
Antoine Poinsot
96ff447fc9
tests: add a datadir migration functional test
This is currently to test database migrations at the functional level, but
is also more generally useful to test backward compatibility.
2023-04-05 17:30:01 +02:00
Antoine Poinsot
f262ca2d1c
tests: reduce the number of workers for the executor
We don't use the executor much anyways.
2023-04-05 12:41:04 +02:00
Antoine Poinsot
0d75f0a2c7
tests: handle multiple recovery paths in MultiSigner 2023-04-04 11:53:23 +02:00
Antoine Poinsot
3aa9980635
tests: simplify the MultiSigner 2023-04-04 11:53:23 +02:00
Antoine Poinsot
9290596823
qa: test using lianad with a multisig descriptor 2023-01-24 19:38:35 +01:00
Antoine Poinsot
3c82173f46
qa: abstract the signer from the Lianad class
That's prep work to introduce a multisig
2023-01-24 19:38:34 +01:00
Antoine Poinsot
3b5cbd5122
qa: introduce a sign_and_broadcast utility 2022-12-09 12:27:50 +01:00
Antoine Poinsot
d362885b85
qa: record the recovery xpub too 2022-12-09 12:27:49 +01:00
Antoine Poinsot
dc61a1c3bd
commands: remove discrepancy between blockheight and block_height 2022-12-07 11:42:17 +01:00
Antoine Poinsot
f5ff0fad36
daemon: 'revaultd' name usage leftovers 2022-11-18 18:33:07 +01:00
Antoine Poinsot
968a7d17a0
daemon: rename Minisafe to Liana 2022-11-17 17:10:22 +01:00
Antoine Poinsot
4bd65213e2
commands: swap the outpoints and destinations arguments to createspend
The outpoints argument could eventually be made optional in order to
introduce some automated coin selection. So it makes more sense for it
to be after a required parameter, the destinations.
2022-11-17 15:15:22 +01:00
Antoine Poinsot
8a22f5e8c9
qa: functional tests for block chain rescans 2022-11-14 09:20:28 +01:00
Antoine Poinsot
1320ee30ba
daemon: use multipath descriptors
In config, expect to be given a multipath descriptor that contains a
derivation path for both receive and change addresses, but only for
those.

Instead of 'xpub/*', start using 'xpub/0/*' and 'xpub/1/*'.

When creating the watchonly wallet on bitcoind import both the receive
and change descriptors.

When polling, check for coins on both descriptors.
2022-10-24 15:00:14 +02:00
Antoine Poinsot
af9f0aeaed
qa: replace our PSBT implementation with a tweaked version of Bitcoin Core's
This replaces our existing implementation of PSBTs with a more
straightforward one, adapted from the Bitcoin Core functional tests
framework. This fixes a few flakes that occured because the previous
implementation could produce invalid PSBTs.

The Bitcoin Core implementation is pretty low level and was adapted to
treat mappings as such (the value in the PSBTMap can itself be a
mapping, like for partial signatures or BIP32 derivation paths).

The rest of the diff is adapting the users of PSBT to use the new
implementation and the clearly superior interface (yay!).
2022-10-19 12:07:22 +02:00
Antoine Poinsot
eff39ee35a
rpc: a new 'broadcastspend' command 2022-10-18 19:54:03 +02:00
Antoine Poinsot
a9b0e5e559
qa: functional tests for block chain reorganization 2022-10-18 19:15:55 +02:00
Antoine Poinsot
e88bbbe65b
poller: block chain reorganization handling 2022-10-18 19:15:54 +02:00
Antoine Poinsot
99ab0d7add
commands: add a 'spend_info' field to the 'listcoins' entries 2022-10-17 11:47:42 +02:00
Antoine Poinsot
c73e8a42dd
commands: add a new 'delspendtx' command 2022-10-01 14:05:27 +02:00
Antoine Poinsot
7d015bcf43
jsonrpc: add a 'createspend' RPC command
Since the Spend transaction command requires some parameters, this
implements the parameter-getting logic on the JSONRPC side as well.

This allows us to implement an end-to-end functional test of the
transaction flow using an external way to broadcast it. From the input
coins creation, to the Spend transaction broadcast.
2022-09-15 11:41:33 +02:00
Antoine Poinsot
7468a7fcfb
qa: add PSBT and transaction serialization to the test framework
Copied it from revaultd.
2022-09-15 11:41:32 +02:00
Antoine Poinsot
09f59c417b
qa: fix the UDS class' forwarding method calls as JSONRPC calls
We weren't passing arguments if they were a list!
2022-09-15 11:41:32 +02:00
Antoine Poinsot
eeac67dc0a
qa: shut down the daemon via the JSONRPC interface at teardown 2022-08-17 19:39:58 +02:00
Antoine Poinsot
e510c0a30d
config: separate the Bitcoin and bitcoind-specifc settings 2022-08-17 19:39:56 +02:00