tests: regtest: add swapserver mining fee argument
What changed, and why it matters
This commit only updates a test script for Electrum's regression testing. It changes how a test command calls the reverse-swap feature by adding an explicit provider mining fee argument taken from a prior dry-run. There is no change to production wallet code, no user-facing behavior change, and no security fix or vulnerability evident.
No security action needed. Treat as routine test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/regtest/regtest.sh in three test scenarios (swapserver_success, swapserver_forceclose, swapserver_refund). Previously the test invoked reverse_swap 0.02 $onchain_amount. Now it extracts .provider_mining_fee from the dry-run JSON and passes it via --provider_mining_fee. This is a test-suite adjustment to match a likely CLI/API change requiring the mining fee to be specified explicitly. No application logic is altered.
Changed components
tests/regtest/regtest.shInspect captured patch +6 / −3
diff --git a/tests/regtest/regtest.sh b/tests/regtest/regtest.sh
index 0c64ae0..2d61e20 100755
--- a/tests/regtest/regtest.sh
+++ b/tests/regtest/regtest.sh
@@ -248,7 +248,8 @@ if [[ $1 == "swapserver_success" ]]; then
echo "alice initiates swap"
dryrun=$($alice reverse_swap 0.02 dryrun)
onchain_amount=$(echo $dryrun| jq -r ".onchain_amount")
- swap=$($alice reverse_swap 0.02 $onchain_amount)
+ swapserver_mining_fee=$(echo $dryrun| jq -r ".provider_mining_fee")
+ swap=$($alice reverse_swap 0.02 $onchain_amount --provider_mining_fee $swapserver_mining_fee)
echo $swap | jq
funding_txid=$(echo $swap| jq -r ".funding_txid")
new_blocks 1
@@ -272,7 +273,8 @@ if [[ $1 == "swapserver_forceclose" ]]; then
echo "alice initiates swap"
dryrun=$($alice reverse_swap 0.02 dryrun)
onchain_amount=$(echo $dryrun| jq -r ".onchain_amount")
- swap=$($alice reverse_swap 0.02 $onchain_amount)
+ swapserver_mining_fee=$(echo $dryrun| jq -r ".provider_mining_fee")
+ swap=$($alice reverse_swap 0.02 $onchain_amount --provider_mining_fee $swapserver_mining_fee)
echo $swap | jq
funding_txid=$(echo $swap| jq -r ".funding_txid")
ctx_id=$($bob close_channel --force $channel)
@@ -307,7 +309,8 @@ if [[ $1 == "swapserver_refund" ]]; then
echo "alice initiates swap"
dryrun=$($alice reverse_swap 0.02 dryrun)
onchain_amount=$(echo $dryrun| jq -r ".onchain_amount")
- swap=$($alice reverse_swap 0.02 $onchain_amount)
+ swapserver_mining_fee=$(echo $dryrun| jq -r ".provider_mining_fee")
+ swap=$($alice reverse_swap 0.02 $onchain_amount --provider_mining_fee $swapserver_mining_fee)
echo $swap | jq
funding_txid=$(echo $swap| jq -r ".funding_txid")
new_blocks 140
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.