Skip to content

Commit db12ff6

Browse files
committed
cmd/loop: record static autoloop CLI
Add recorded CLI coverage for selecting the static-address autoloop loop-in source, displaying the resulting parameters, and showing a static loop-in suggestion. Also record the non-experimental rejection so the opt-in gate is covered. Update existing liquidity fixtures with the default loop-in source field emitted by the newer RPC shape.
1 parent b2edd7e commit db12ff6

5 files changed

Lines changed: 515 additions & 0 deletions

File tree

cmd/loop/testdata/sessions/AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Base URL: `http://127.0.0.1:12345`
7070
| `misc/` | `loop terms` |
7171
| `quote/` | `loop quote out` (success + verbose), `loop quote in` (help + verbose), `loop quote out` (help), `loop quote in` (deposit_outpoint success), `loop quote in` (positional + last_hop) |
7272
| `static/` | `loop static withdraw` (no selection error), `loop static withdraw` (invalid utxo), `loop static withdraw` (all success), `loop static withdraw` (utxo + dest_addr success), `loop static listwithdrawals`, `loop static listswaps` |
73+
| `static-autoloop/` | `loop setparams --loopinsource static-address` (success + no-experimental error), `loop getparams` (static-address loop-in source), `loop suggestswaps` (static loop-in suggestion) |
7374
| `static-loop-in/` | `loop static new`, `loop static` (help), `loop static listunspent` (incl alias), `loop static listdeposits`, `loop static summary`, `loop static in` (multiple args/flags cases), `loop static in` (duplicate outpoints), `loop static in` (positional low amount error), `loop static in` (positional + last_hop + payment_timeout), `loop static in` (all cancel) |
7475
| `static-filters/` | `loop static listdeposits --filter ...` for each state (deposited/withdrawing/withdrawn/looping_in/looped_in/publish_expired_deposit/sweep_htlc_timeout/htlc_timeout_swept/wait_for_expiry_sweep/expired/failed) |
7576
| `swaps/` | `loop listswaps` (success + conflicting filters + loop_out_only filters + loop_in_only), `loop swapinfo` (success + invalid id + id flag errors), `loop abandonswap` (help + invalid id + success) |
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
{
2+
"metadata": {
3+
"args": [
4+
"/home/user/bin/loop",
5+
"setparams",
6+
"--network",
7+
"regtest",
8+
"--loopinsource",
9+
"static-address",
10+
"--minamt",
11+
"250000",
12+
"--maxamt",
13+
"1000000",
14+
"--feepercent",
15+
"5",
16+
"--autoloop",
17+
"--autobudget",
18+
"50000",
19+
"--autoinflight",
20+
"1"
21+
],
22+
"version": "0.33.0-beta commit=v0.33.0-beta-74-g6a3c3e1df5f807b450d3ba663f4824f6588e1c13 commit_hash=6a3c3e1df5f807b450d3ba663f4824f6588e1c13",
23+
"duration": 32231921,
24+
"clock_start_unix": 1779406641
25+
},
26+
"events": [
27+
{
28+
"time_ms": 10,
29+
"kind": "grpc",
30+
"data": {
31+
"method": "/looprpc.SwapClient/GetLiquidityParams",
32+
"event": "request",
33+
"message_type": "looprpc.GetLiquidityParamsRequest",
34+
"payload": {}
35+
}
36+
},
37+
{
38+
"time_ms": 16,
39+
"kind": "grpc",
40+
"data": {
41+
"method": "/looprpc.SwapClient/GetLiquidityParams",
42+
"event": "response",
43+
"message_type": "looprpc.LiquidityParameters",
44+
"payload": {
45+
"rules": [
46+
{
47+
"channel_id": "0",
48+
"swap_type": "LOOP_IN",
49+
"pubkey": "AgN4nvpxLgk471Ol2/D2BGUJ9l/FOlv8dRHcZ/6+oaFl",
50+
"type": "THRESHOLD",
51+
"incoming_threshold": 0,
52+
"outgoing_threshold": 60
53+
}
54+
],
55+
"fee_ppm": "50000",
56+
"sweep_fee_rate_sat_per_vbyte": "0",
57+
"max_swap_fee_ppm": "0",
58+
"max_routing_fee_ppm": "0",
59+
"max_prepay_routing_fee_ppm": "0",
60+
"max_prepay_sat": "0",
61+
"max_miner_fee_sat": "0",
62+
"sweep_conf_target": 100,
63+
"failure_backoff_sec": "86400",
64+
"autoloop": true,
65+
"autoloop_budget_sat": "50000",
66+
"autoloop_budget_start_sec": "0",
67+
"auto_max_in_flight": "1",
68+
"min_swap_amount": "250000",
69+
"max_swap_amount": "1000000",
70+
"htlc_conf_target": 6,
71+
"autoloop_dest_address": "",
72+
"autoloop_budget_refresh_period_sec": "604800",
73+
"autoloop_budget_last_refresh": "1779405910",
74+
"easy_autoloop": false,
75+
"easy_autoloop_local_target_sat": "0",
76+
"account": "",
77+
"account_addr_type": "ADDRESS_TYPE_UNKNOWN",
78+
"easy_asset_params": {},
79+
"fast_swap_publication": true,
80+
"easy_autoloop_excluded_peers": [],
81+
"loop_in_source": "LOOP_IN_SOURCE_STATIC_ADDRESS"
82+
}
83+
}
84+
},
85+
{
86+
"time_ms": 18,
87+
"kind": "grpc",
88+
"data": {
89+
"method": "/looprpc.SwapClient/SetLiquidityParams",
90+
"event": "request",
91+
"message_type": "looprpc.SetLiquidityParamsRequest",
92+
"payload": {
93+
"parameters": {
94+
"rules": [
95+
{
96+
"channel_id": "0",
97+
"swap_type": "LOOP_IN",
98+
"pubkey": "AgN4nvpxLgk471Ol2/D2BGUJ9l/FOlv8dRHcZ/6+oaFl",
99+
"type": "THRESHOLD",
100+
"incoming_threshold": 0,
101+
"outgoing_threshold": 60
102+
}
103+
],
104+
"fee_ppm": "50000",
105+
"sweep_fee_rate_sat_per_vbyte": "0",
106+
"max_swap_fee_ppm": "0",
107+
"max_routing_fee_ppm": "0",
108+
"max_prepay_routing_fee_ppm": "0",
109+
"max_prepay_sat": "0",
110+
"max_miner_fee_sat": "0",
111+
"sweep_conf_target": 100,
112+
"failure_backoff_sec": "86400",
113+
"autoloop": true,
114+
"autoloop_budget_sat": "50000",
115+
"autoloop_budget_start_sec": "0",
116+
"auto_max_in_flight": "1",
117+
"min_swap_amount": "250000",
118+
"max_swap_amount": "1000000",
119+
"htlc_conf_target": 6,
120+
"autoloop_dest_address": "",
121+
"autoloop_budget_refresh_period_sec": "604800",
122+
"autoloop_budget_last_refresh": "1779405910",
123+
"easy_autoloop": false,
124+
"easy_autoloop_local_target_sat": "0",
125+
"account": "",
126+
"account_addr_type": "ADDRESS_TYPE_UNKNOWN",
127+
"easy_asset_params": {},
128+
"fast_swap_publication": true,
129+
"easy_autoloop_excluded_peers": [],
130+
"loop_in_source": "LOOP_IN_SOURCE_STATIC_ADDRESS"
131+
}
132+
}
133+
}
134+
},
135+
{
136+
"time_ms": 31,
137+
"kind": "grpc",
138+
"data": {
139+
"method": "/looprpc.SwapClient/SetLiquidityParams",
140+
"event": "response",
141+
"message_type": "looprpc.SetLiquidityParamsResponse",
142+
"payload": {}
143+
}
144+
},
145+
{
146+
"time_ms": 32,
147+
"kind": "exit",
148+
"data": {}
149+
}
150+
]
151+
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"metadata": {
3+
"args": [
4+
"/home/user/bin/loop",
5+
"getparams",
6+
"--network",
7+
"regtest"
8+
],
9+
"version": "0.33.0-beta commit=v0.33.0-beta-74-g6a3c3e1df5f807b450d3ba663f4824f6588e1c13 commit_hash=6a3c3e1df5f807b450d3ba663f4824f6588e1c13",
10+
"duration": 12324887,
11+
"clock_start_unix": 1779406647
12+
},
13+
"events": [
14+
{
15+
"time_ms": 1,
16+
"kind": "grpc",
17+
"data": {
18+
"method": "/looprpc.SwapClient/GetLiquidityParams",
19+
"event": "request",
20+
"message_type": "looprpc.GetLiquidityParamsRequest",
21+
"payload": {}
22+
}
23+
},
24+
{
25+
"time_ms": 5,
26+
"kind": "grpc",
27+
"data": {
28+
"method": "/looprpc.SwapClient/GetLiquidityParams",
29+
"event": "response",
30+
"message_type": "looprpc.LiquidityParameters",
31+
"payload": {
32+
"rules": [
33+
{
34+
"channel_id": "0",
35+
"swap_type": "LOOP_IN",
36+
"pubkey": "AgN4nvpxLgk471Ol2/D2BGUJ9l/FOlv8dRHcZ/6+oaFl",
37+
"type": "THRESHOLD",
38+
"incoming_threshold": 0,
39+
"outgoing_threshold": 60
40+
}
41+
],
42+
"fee_ppm": "50000",
43+
"sweep_fee_rate_sat_per_vbyte": "0",
44+
"max_swap_fee_ppm": "0",
45+
"max_routing_fee_ppm": "0",
46+
"max_prepay_routing_fee_ppm": "0",
47+
"max_prepay_sat": "0",
48+
"max_miner_fee_sat": "0",
49+
"sweep_conf_target": 100,
50+
"failure_backoff_sec": "86400",
51+
"autoloop": true,
52+
"autoloop_budget_sat": "50000",
53+
"autoloop_budget_start_sec": "0",
54+
"auto_max_in_flight": "1",
55+
"min_swap_amount": "250000",
56+
"max_swap_amount": "1000000",
57+
"htlc_conf_target": 6,
58+
"autoloop_dest_address": "",
59+
"autoloop_budget_refresh_period_sec": "604800",
60+
"autoloop_budget_last_refresh": "1779405910",
61+
"easy_autoloop": false,
62+
"easy_autoloop_local_target_sat": "0",
63+
"account": "",
64+
"account_addr_type": "ADDRESS_TYPE_UNKNOWN",
65+
"easy_asset_params": {},
66+
"fast_swap_publication": true,
67+
"easy_autoloop_excluded_peers": [],
68+
"loop_in_source": "LOOP_IN_SOURCE_STATIC_ADDRESS"
69+
}
70+
}
71+
},
72+
{
73+
"time_ms": 12,
74+
"kind": "stdout",
75+
"data": {
76+
"lines": [
77+
"{\n",
78+
" \"account\": \"\",\n",
79+
" \"account_addr_type\": \"ADDRESS_TYPE_UNKNOWN\",\n",
80+
" \"auto_max_in_flight\": \"1\",\n",
81+
" \"autoloop\": true,\n",
82+
" \"autoloop_budget_last_refresh\": \"1779405910\",\n",
83+
" \"autoloop_budget_refresh_period_sec\": \"604800\",\n",
84+
" \"autoloop_budget_sat\": \"50000\",\n",
85+
" \"autoloop_budget_start_sec\": \"0\",\n",
86+
" \"autoloop_dest_address\": \"\",\n",
87+
" \"easy_asset_params\": {},\n",
88+
" \"easy_autoloop\": false,\n",
89+
" \"easy_autoloop_excluded_peers\": [],\n",
90+
" \"easy_autoloop_local_target_sat\": \"0\",\n",
91+
" \"failure_backoff_sec\": \"86400\",\n",
92+
" \"fast_swap_publication\": true,\n",
93+
" \"fee_ppm\": \"50000\",\n",
94+
" \"htlc_conf_target\": 6,\n",
95+
" \"loop_in_source\": \"LOOP_IN_SOURCE_STATIC_ADDRESS\",\n",
96+
" \"max_miner_fee_sat\": \"0\",\n",
97+
" \"max_prepay_routing_fee_ppm\": \"0\",\n",
98+
" \"max_prepay_sat\": \"0\",\n",
99+
" \"max_routing_fee_ppm\": \"0\",\n",
100+
" \"max_swap_amount\": \"1000000\",\n",
101+
" \"max_swap_fee_ppm\": \"0\",\n",
102+
" \"min_swap_amount\": \"250000\",\n",
103+
" \"rules\": [\n",
104+
" {\n",
105+
" \"channel_id\": \"0\",\n",
106+
" \"incoming_threshold\": 0,\n",
107+
" \"outgoing_threshold\": 60,\n",
108+
" \"pubkey\": \"0203789efa712e0938ef53a5dbf0f6046509f65fc53a5bfc7511dc67febea1a165\",\n",
109+
" \"swap_type\": \"LOOP_IN\",\n",
110+
" \"type\": \"THRESHOLD\"\n",
111+
" }\n",
112+
" ],\n",
113+
" \"sweep_conf_target\": 100,\n",
114+
" \"sweep_fee_rate_sat_per_vbyte\": \"0\"\n",
115+
"}\n"
116+
]
117+
}
118+
},
119+
{
120+
"time_ms": 12,
121+
"kind": "exit",
122+
"data": {}
123+
}
124+
]
125+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"metadata": {
3+
"args": [
4+
"/home/user/bin/loop",
5+
"suggestswaps",
6+
"--network",
7+
"regtest"
8+
],
9+
"version": "0.33.0-beta commit=v0.33.0-beta-74-g6a3c3e1df5f807b450d3ba663f4824f6588e1c13 commit_hash=6a3c3e1df5f807b450d3ba663f4824f6588e1c13",
10+
"duration": 44264819,
11+
"clock_start_unix": 1779406653
12+
},
13+
"events": [
14+
{
15+
"time_ms": 1,
16+
"kind": "grpc",
17+
"data": {
18+
"method": "/looprpc.SwapClient/SuggestSwaps",
19+
"event": "request",
20+
"message_type": "looprpc.SuggestSwapsRequest",
21+
"payload": {}
22+
}
23+
},
24+
{
25+
"time_ms": 43,
26+
"kind": "grpc",
27+
"data": {
28+
"method": "/looprpc.SwapClient/SuggestSwaps",
29+
"event": "response",
30+
"message_type": "looprpc.SuggestSwapsResponse",
31+
"payload": {
32+
"loop_out": [],
33+
"loop_in": [],
34+
"static_loop_in": [
35+
{
36+
"outpoints": [
37+
"9cfb0ec5ab2c851b4db5fe372cc3573f4074c436e50b13d2b7d214e45571def9:1"
38+
],
39+
"max_swap_fee_satoshis": "1828",
40+
"last_hop": "AgN4nvpxLgk471Ol2/D2BGUJ9l/FOlv8dRHcZ/6+oaFl",
41+
"label": "[reserved]: autoloop-in",
42+
"initiator": "autoloop",
43+
"route_hints": [],
44+
"private": false,
45+
"payment_timeout_seconds": 0,
46+
"amount": "500000",
47+
"fast": false
48+
}
49+
],
50+
"disqualified": [
51+
{
52+
"channel_id": "127543348887552",
53+
"pubkey": "",
54+
"reason": "AUTO_REASON_CUSTOM_CHANNEL_DATA"
55+
}
56+
]
57+
}
58+
}
59+
},
60+
{
61+
"time_ms": 43,
62+
"kind": "stdout",
63+
"data": {
64+
"lines": [
65+
"{\n",
66+
" \"disqualified\": [\n",
67+
" {\n",
68+
" \"channel_id\": \"127543348887552\",\n",
69+
" \"pubkey\": \"\",\n",
70+
" \"reason\": \"AUTO_REASON_CUSTOM_CHANNEL_DATA\"\n",
71+
" }\n",
72+
" ],\n",
73+
" \"loop_in\": [],\n",
74+
" \"loop_out\": [],\n",
75+
" \"static_loop_in\": [\n",
76+
" {\n",
77+
" \"amount\": \"500000\",\n",
78+
" \"fast\": false,\n",
79+
" \"initiator\": \"autoloop\",\n",
80+
" \"label\": \"[reserved]: autoloop-in\",\n",
81+
" \"last_hop\": \"0203789efa712e0938ef53a5dbf0f6046509f65fc53a5bfc7511dc67febea1a165\",\n",
82+
" \"max_swap_fee_satoshis\": \"1828\",\n",
83+
" \"outpoints\": [\n",
84+
" \"9cfb0ec5ab2c851b4db5fe372cc3573f4074c436e50b13d2b7d214e45571def9:1\"\n",
85+
" ],\n",
86+
" \"payment_timeout_seconds\": 0,\n",
87+
" \"private\": false,\n",
88+
" \"route_hints\": []\n",
89+
" }\n",
90+
" ]\n",
91+
"}\n"
92+
]
93+
}
94+
},
95+
{
96+
"time_ms": 44,
97+
"kind": "exit",
98+
"data": {}
99+
}
100+
]
101+
}

0 commit comments

Comments
 (0)