Skip to content

regtests: swaps: add test for forward-swap success case, and small fix#10637

Merged
ecdsa merged 2 commits into
spesmilo:masterfrom
SomberNight:202605_swap_regtest_forward
May 13, 2026
Merged

regtests: swaps: add test for forward-swap success case, and small fix#10637
ecdsa merged 2 commits into
spesmilo:masterfrom
SomberNight:202605_swap_regtest_forward

Conversation

@SomberNight
Copy link
Copy Markdown
Member

Previously only the reverse-swaps were tested.
Note that what is reverse for the client, is forward for the server, hence testing different scenarios for reverse-swaps (success case, different failure cases) already exercises some of the logic of forward-swaps.

However the swap-protocol request construction and validation is specific to swap direction, and that was not exercised for forward-swaps at all prior to this.

(but duplicating the other testcases probably is not worth)

Previously only the reverse-swaps were tested.
Note that what is reverse for the client, is forward for the server, hence testing different scenarios for reverse-swaps (success case, different failrue cases) already exercises some of the logic of forward-swaps.

However the swap-protocol request construction and validation is specific to swap direction, and that was not exercised for forward-swaps at all prior to this.

(but duplicating the other testcases probably is not worth)
if `$1` was some garbage value (e.g. the 4-character "null" string coming from jq), the exit code of bitcoin_cli was not tested (it was masked by being part of the while's test condition). Instead now wait_until_spent correctly propagates bitcoin_cli's exit code. (due to `set -e` being set at the top level)
@ecdsa ecdsa merged commit b27ab84 into spesmilo:master May 13, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants