mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
testdata: add basic swap sessions
This commit is contained in:
parent
9640e3bd4c
commit
5157dad741
5 changed files with 904 additions and 0 deletions
146
cmd/loop/testdata/sessions/basic-swaps/01_loop-out.json
vendored
Normal file
146
cmd/loop/testdata/sessions/basic-swaps/01_loop-out.json
vendored
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
{
|
||||
"metadata": {
|
||||
"args": [
|
||||
"loop",
|
||||
"out",
|
||||
"--network",
|
||||
"regtest",
|
||||
"500000",
|
||||
"--fast"
|
||||
],
|
||||
"env": {},
|
||||
"version": "0.31.7-beta commit=vbump-lndclient-64-g3b735173216470e023b3b72949dd82af9adbebe1 commit_hash=3b735173216470e023b3b72949dd82af9adbebe1",
|
||||
"duration": 1332472129,
|
||||
"clock_start_unix": 1769407086
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"time_ms": 1,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/LoopOutQuote",
|
||||
"event": "request",
|
||||
"message_type": "looprpc.QuoteRequest",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"conf_target": 9,
|
||||
"external_htlc": false,
|
||||
"swap_publication_deadline": "1769407086",
|
||||
"loop_in_last_hop": "",
|
||||
"loop_in_route_hints": [],
|
||||
"private": false,
|
||||
"deposit_outpoints": [],
|
||||
"asset_info": null,
|
||||
"auto_select_deposits": false,
|
||||
"fast": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 22,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/LoopOutQuote",
|
||||
"event": "response",
|
||||
"message_type": "looprpc.OutQuoteResponse",
|
||||
"payload": {
|
||||
"swap_fee_sat": "3875",
|
||||
"prepay_amt_sat": "1337",
|
||||
"htlc_sweep_fee_sat": "3793",
|
||||
"swap_payment_dest": "AhbcGtFvFiW2ru6gxtm66Xv9DpxBdSBXK4a7EX7jbSWd",
|
||||
"cltv_delta": 0,
|
||||
"conf_target": 9,
|
||||
"asset_rfq_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 23,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"Send off-chain: 500000 sat\n",
|
||||
"Receive on-chain: 492332 sat\n",
|
||||
"Estimated total fee: 7668 sat\n",
|
||||
"\n",
|
||||
"Fast swap requested.\n",
|
||||
"\n",
|
||||
"CONTINUE SWAP? (y/n): "
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 1240,
|
||||
"kind": "stdin",
|
||||
"data": {
|
||||
"text": "y\n"
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 1241,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/LoopOut",
|
||||
"event": "request",
|
||||
"message_type": "looprpc.LoopOutRequest",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"dest": "",
|
||||
"max_swap_routing_fee": "10010",
|
||||
"max_prepay_routing_fee": "36",
|
||||
"max_swap_fee": "3875",
|
||||
"max_prepay_amt": "1337",
|
||||
"max_miner_fee": "948250",
|
||||
"loop_out_channel": "0",
|
||||
"outgoing_chan_set": [],
|
||||
"sweep_conf_target": 9,
|
||||
"htlc_confirmations": 1,
|
||||
"swap_publication_deadline": "1769407086",
|
||||
"label": "",
|
||||
"initiator": "loop-cli",
|
||||
"account": "",
|
||||
"account_addr_type": "ADDRESS_TYPE_UNKNOWN",
|
||||
"is_external_addr": false,
|
||||
"reservation_ids": [],
|
||||
"payment_timeout": 0,
|
||||
"asset_info": null,
|
||||
"asset_rfq_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 1327,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/LoopOut",
|
||||
"event": "response",
|
||||
"message_type": "looprpc.SwapResponse",
|
||||
"payload": {
|
||||
"id": "e5f3a1d5cee33e239571d0c1e8cbc6926cbc1d784b9fe185ff6589e949db4549",
|
||||
"id_bytes": "5fOh1c7jPiOVcdDB6MvGkmy8HXhLn+GF/2WJ6UnbRUk=",
|
||||
"htlc_address": "bcrt1p69ekm32epfcy8ymkqdj5clvh37vmlgw76k9x5nfs76c7qgghnpqqmtf80x",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1p69ekm32epfcy8ymkqdj5clvh37vmlgw76k9x5nfs76c7qgghnpqqmtf80x",
|
||||
"server_message": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 1329,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"Swap initiated\n",
|
||||
"ID: e5f3a1d5cee33e239571d0c1e8cbc6926cbc1d784b9fe185ff6589e949db4549\n",
|
||||
"\n",
|
||||
"Run `loop monitor` to monitor progress.\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 1332,
|
||||
"kind": "exit",
|
||||
"data": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
131
cmd/loop/testdata/sessions/basic-swaps/02_loop-in.json
vendored
Normal file
131
cmd/loop/testdata/sessions/basic-swaps/02_loop-in.json
vendored
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
{
|
||||
"metadata": {
|
||||
"args": [
|
||||
"loop",
|
||||
"in",
|
||||
"--network",
|
||||
"regtest",
|
||||
"500000"
|
||||
],
|
||||
"env": {},
|
||||
"version": "0.31.7-beta commit=vbump-lndclient-69-g057ef82340ab279a5659ab6ae7edab61448a2acd commit_hash=057ef82340ab279a5659ab6ae7edab61448a2acd",
|
||||
"duration": 2146386627,
|
||||
"clock_start_unix": 1769407086
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"time_ms": 5,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/GetLoopInQuote",
|
||||
"event": "request",
|
||||
"message_type": "looprpc.QuoteRequest",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"conf_target": 0,
|
||||
"external_htlc": false,
|
||||
"swap_publication_deadline": "0",
|
||||
"loop_in_last_hop": "",
|
||||
"loop_in_route_hints": [],
|
||||
"private": false,
|
||||
"deposit_outpoints": [],
|
||||
"asset_info": null,
|
||||
"auto_select_deposits": false,
|
||||
"fast": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 444,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/GetLoopInQuote",
|
||||
"event": "response",
|
||||
"message_type": "looprpc.InQuoteResponse",
|
||||
"payload": {
|
||||
"swap_fee_sat": "1825",
|
||||
"htlc_publish_fee_sat": "3875",
|
||||
"cltv_delta": 0,
|
||||
"conf_target": 6,
|
||||
"quoted_amt": "500000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 445,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"Send on-chain: 500000 sat\n",
|
||||
"Receive off-chain: 494300 sat\n",
|
||||
"Estimated total fee: 5700 sat\n",
|
||||
"\n",
|
||||
"CONTINUE SWAP? (y/n): "
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 1682,
|
||||
"kind": "stdin",
|
||||
"data": {
|
||||
"text": "y\n"
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 1682,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/LoopIn",
|
||||
"event": "request",
|
||||
"message_type": "looprpc.LoopInRequest",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"max_swap_fee": "1825",
|
||||
"max_miner_fee": "11625",
|
||||
"last_hop": "",
|
||||
"external_htlc": false,
|
||||
"htlc_conf_target": 0,
|
||||
"label": "",
|
||||
"initiator": "loop-cli",
|
||||
"route_hints": [],
|
||||
"private": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 2140,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/LoopIn",
|
||||
"event": "response",
|
||||
"message_type": "looprpc.SwapResponse",
|
||||
"payload": {
|
||||
"id": "33b431ce62ab7f8f3ff5e2aee9452ec9aa18713e734ecd79fc9cfb4bd77cc7d8",
|
||||
"id_bytes": "M7QxzmKrf48/9eKu6UUuyaoYcT5zTs15/Jz7S9d8x9g=",
|
||||
"htlc_address": "bcrt1pmtw7fch8de39wxfqunuucudgulkvyxm59epz9p0ph673squ7l2ns3gpcsu",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1pmtw7fch8de39wxfqunuucudgulkvyxm59epz9p0ph673squ7l2ns3gpcsu",
|
||||
"server_message": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 2141,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"Swap initiated\n",
|
||||
"ID: 33b431ce62ab7f8f3ff5e2aee9452ec9aa18713e734ecd79fc9cfb4bd77cc7d8\n",
|
||||
"HTLC address (P2TR): bcrt1pmtw7fch8de39wxfqunuucudgulkvyxm59epz9p0ph673squ7l2ns3gpcsu\n",
|
||||
"\n",
|
||||
"Run `loop monitor` to monitor progress.\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 2146,
|
||||
"kind": "exit",
|
||||
"data": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
428
cmd/loop/testdata/sessions/basic-swaps/03_loop-monitor.json
vendored
Normal file
428
cmd/loop/testdata/sessions/basic-swaps/03_loop-monitor.json
vendored
Normal file
|
|
@ -0,0 +1,428 @@
|
|||
{
|
||||
"metadata": {
|
||||
"args": [
|
||||
"loop",
|
||||
"monitor",
|
||||
"--network",
|
||||
"regtest"
|
||||
],
|
||||
"env": {},
|
||||
"version": "0.31.7-beta commit=vbump-lndclient-70-g352a68cd43f1976a937faaf76041bc078fdd16f6 commit_hash=352a68cd43f1976a937faaf76041bc078fdd16f6",
|
||||
"run_error": "recv: rpc error: code = Canceled desc = context canceled",
|
||||
"duration": 58532880576,
|
||||
"clock_start_unix": 1769407086
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"time_ms": 8,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "send",
|
||||
"message_type": "looprpc.MonitorRequest",
|
||||
"payload": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 8,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"Note: offchain cost may report as 0 after loopd restart during swap\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 13,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "33b431ce62ab7f8f3ff5e2aee9452ec9aa18713e734ecd79fc9cfb4bd77cc7d8",
|
||||
"id_bytes": "M7QxzmKrf48/9eKu6UUuyaoYcT5zTs15/Jz7S9d8x9g=",
|
||||
"type": "LOOP_IN",
|
||||
"state": "INVOICE_SETTLED",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769413263544127799",
|
||||
"last_update_time": "1769413312288899857",
|
||||
"htlc_address": "bcrt1pmtw7fch8de39wxfqunuucudgulkvyxm59epz9p0ph673squ7l2ns3gpcsu",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1pmtw7fch8de39wxfqunuucudgulkvyxm59epz9p0ph673squ7l2ns3gpcsu",
|
||||
"cost_server": "0",
|
||||
"cost_onchain": "3850",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 13,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "4a8f1dd97addf8222c7613f6a41e3942f4bf9ca64026107c484c1f7e551df658",
|
||||
"id_bytes": "So8d2Xrd+CIsdhP2pB45QvS/nKZAJhB8SEwfflUd9lg=",
|
||||
"type": "LOOP_OUT",
|
||||
"state": "SUCCESS",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769407041704702192",
|
||||
"last_update_time": "1769413318432807159",
|
||||
"htlc_address": "bcrt1pmvvj28wnuwe70xfy6kjzwxcg7cx0kc2dy8l6armutegs8y3p0j7qg0atua",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1pmvvj28wnuwe70xfy6kjzwxcg7cx0kc2dy8l6armutegs8y3p0j7qg0atua",
|
||||
"cost_server": "3875",
|
||||
"cost_onchain": "2775",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 14,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "e5f3a1d5cee33e239571d0c1e8cbc6926cbc1d784b9fe185ff6589e949db4549",
|
||||
"id_bytes": "5fOh1c7jPiOVcdDB6MvGkmy8HXhLn+GF/2WJ6UnbRUk=",
|
||||
"type": "LOOP_OUT",
|
||||
"state": "SUCCESS",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769407087874686997",
|
||||
"last_update_time": "1769413322775449292",
|
||||
"htlc_address": "bcrt1p69ekm32epfcy8ymkqdj5clvh37vmlgw76k9x5nfs76c7qgghnpqqmtf80x",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1p69ekm32epfcy8ymkqdj5clvh37vmlgw76k9x5nfs76c7qgghnpqqmtf80x",
|
||||
"cost_server": "3875",
|
||||
"cost_onchain": "2775",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 14,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "39424d7e6cf6d9c613c4026f5e6da48fd2b65989007895a0db7b937b7f8563e4",
|
||||
"id_bytes": "OUJNfmz22cYTxAJvXm2kj9K2WYkAeJWg23uTe3+FY+Q=",
|
||||
"type": "LOOP_OUT",
|
||||
"state": "SUCCESS",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769413204269210604",
|
||||
"last_update_time": "1769413329442159169",
|
||||
"htlc_address": "bcrt1prz80rm04fhf5y73ps9txxslnhj8e3nqcsnmz6ca6vs6jkrce2l9svtd8sl",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1prz80rm04fhf5y73ps9txxslnhj8e3nqcsnmz6ca6vs6jkrce2l9svtd8sl",
|
||||
"cost_server": "3875",
|
||||
"cost_onchain": "2774",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 14,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"2026-01-26T02:41:52-05:00 LOOP_IN INVOICE_SETTLED 0.00500000 BTC - P2TR: bcrt1pmtw7fch8de39wxfqunuucudgulkvyxm59epz9p0ph673squ7l2ns3gpcsu (cost: server 0, onchain 3850, offchain 0)\n",
|
||||
"2026-01-26T02:41:58-05:00 LOOP_OUT SUCCESS 0.00500000 BTC - (cost: server 3875, onchain 2775, offchain 0)\n",
|
||||
"2026-01-26T02:42:02-05:00 LOOP_OUT SUCCESS 0.00500000 BTC - (cost: server 3875, onchain 2775, offchain 0)\n",
|
||||
"2026-01-26T02:42:09-05:00 LOOP_OUT SUCCESS 0.00500000 BTC - (cost: server 3875, onchain 2774, offchain 0)\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 19978,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "13da0be986d8a1f095794f78c5e716150e93c92834e3be52f6eb2fbfc84b8eb0",
|
||||
"id_bytes": "E9oL6YbYofCVeU94xecWFQ6TySg0475S9usvv8hLjrA=",
|
||||
"type": "LOOP_OUT",
|
||||
"state": "INITIATED",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769414430311530071",
|
||||
"last_update_time": "1769414430311530071",
|
||||
"htlc_address": "bcrt1ps8vvwey05ezrmhe4mpz60nre256ggl2uyazs7fayh83z7ptnclnstaxvu2",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1ps8vvwey05ezrmhe4mpz60nre256ggl2uyazs7fayh83z7ptnclnstaxvu2",
|
||||
"cost_server": "0",
|
||||
"cost_onchain": "0",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 19978,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"2026-01-26T03:00:30-05:00 LOOP_OUT INITIATED 0.00500000 BTC - \n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 32802,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "3f4ec343ba4087eec3cdf501b4e19733d9685cc151db360bb67d2c924677ce71",
|
||||
"id_bytes": "P07DQ7pAh+7DzfUBtOGXM9loXMFR2zYLtn0skkZ3znE=",
|
||||
"type": "LOOP_IN",
|
||||
"state": "INITIATED",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769414443188873986",
|
||||
"last_update_time": "1769414443188873986",
|
||||
"htlc_address": "bcrt1ppuw9wtl65avd026t9nkxux8whz3gyhkjh6n9cryp8a5xz9jacf9qlgxsch",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1ppuw9wtl65avd026t9nkxux8whz3gyhkjh6n9cryp8a5xz9jacf9qlgxsch",
|
||||
"cost_server": "0",
|
||||
"cost_onchain": "0",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 32802,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"2026-01-26T03:00:43-05:00 LOOP_IN INITIATED 0.00500000 BTC - P2TR: bcrt1ppuw9wtl65avd026t9nkxux8whz3gyhkjh6n9cryp8a5xz9jacf9qlgxsch\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 32829,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "3f4ec343ba4087eec3cdf501b4e19733d9685cc151db360bb67d2c924677ce71",
|
||||
"id_bytes": "P07DQ7pAh+7DzfUBtOGXM9loXMFR2zYLtn0skkZ3znE=",
|
||||
"type": "LOOP_IN",
|
||||
"state": "HTLC_PUBLISHED",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769414443188873986",
|
||||
"last_update_time": "1769414443212089572",
|
||||
"htlc_address": "bcrt1ppuw9wtl65avd026t9nkxux8whz3gyhkjh6n9cryp8a5xz9jacf9qlgxsch",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1ppuw9wtl65avd026t9nkxux8whz3gyhkjh6n9cryp8a5xz9jacf9qlgxsch",
|
||||
"cost_server": "0",
|
||||
"cost_onchain": "0",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 32829,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"2026-01-26T03:00:43-05:00 LOOP_IN HTLC_PUBLISHED 0.00500000 BTC - P2TR: bcrt1ppuw9wtl65avd026t9nkxux8whz3gyhkjh6n9cryp8a5xz9jacf9qlgxsch\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 39513,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "3f4ec343ba4087eec3cdf501b4e19733d9685cc151db360bb67d2c924677ce71",
|
||||
"id_bytes": "P07DQ7pAh+7DzfUBtOGXM9loXMFR2zYLtn0skkZ3znE=",
|
||||
"type": "LOOP_IN",
|
||||
"state": "INVOICE_SETTLED",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769414443188873986",
|
||||
"last_update_time": "1769414449902523194",
|
||||
"htlc_address": "bcrt1ppuw9wtl65avd026t9nkxux8whz3gyhkjh6n9cryp8a5xz9jacf9qlgxsch",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1ppuw9wtl65avd026t9nkxux8whz3gyhkjh6n9cryp8a5xz9jacf9qlgxsch",
|
||||
"cost_server": "0",
|
||||
"cost_onchain": "3850",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 39513,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"2026-01-26T03:00:49-05:00 LOOP_IN INVOICE_SETTLED 0.00500000 BTC - P2TR: bcrt1ppuw9wtl65avd026t9nkxux8whz3gyhkjh6n9cryp8a5xz9jacf9qlgxsch (cost: server 0, onchain 3850, offchain 0)\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 40341,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "13da0be986d8a1f095794f78c5e716150e93c92834e3be52f6eb2fbfc84b8eb0",
|
||||
"id_bytes": "E9oL6YbYofCVeU94xecWFQ6TySg0475S9usvv8hLjrA=",
|
||||
"type": "LOOP_OUT",
|
||||
"state": "PREIMAGE_REVEALED",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769414430311530071",
|
||||
"last_update_time": "1769414450735780318",
|
||||
"htlc_address": "bcrt1ps8vvwey05ezrmhe4mpz60nre256ggl2uyazs7fayh83z7ptnclnstaxvu2",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1ps8vvwey05ezrmhe4mpz60nre256ggl2uyazs7fayh83z7ptnclnstaxvu2",
|
||||
"cost_server": "0",
|
||||
"cost_onchain": "0",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 40341,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"2026-01-26T03:00:50-05:00 LOOP_OUT PREIMAGE_REVEALED 0.00500000 BTC - \n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 44110,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "recv",
|
||||
"message_type": "looprpc.SwapStatus",
|
||||
"payload": {
|
||||
"amt": "500000",
|
||||
"id": "13da0be986d8a1f095794f78c5e716150e93c92834e3be52f6eb2fbfc84b8eb0",
|
||||
"id_bytes": "E9oL6YbYofCVeU94xecWFQ6TySg0475S9usvv8hLjrA=",
|
||||
"type": "LOOP_OUT",
|
||||
"state": "SUCCESS",
|
||||
"failure_reason": "FAILURE_REASON_NONE",
|
||||
"initiation_time": "1769414430311530071",
|
||||
"last_update_time": "1769414454503356191",
|
||||
"htlc_address": "bcrt1ps8vvwey05ezrmhe4mpz60nre256ggl2uyazs7fayh83z7ptnclnstaxvu2",
|
||||
"htlc_address_p2wsh": "",
|
||||
"htlc_address_p2tr": "bcrt1ps8vvwey05ezrmhe4mpz60nre256ggl2uyazs7fayh83z7ptnclnstaxvu2",
|
||||
"cost_server": "3873",
|
||||
"cost_onchain": "2774",
|
||||
"cost_offchain": "0",
|
||||
"last_hop": "",
|
||||
"outgoing_chan_set": [],
|
||||
"label": "",
|
||||
"asset_info": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 44110,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"2026-01-26T03:00:54-05:00 LOOP_OUT SUCCESS 0.00500000 BTC - (cost: server 3873, onchain 2774, offchain 0)\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 58531,
|
||||
"kind": "signal",
|
||||
"data": {
|
||||
"signal": "interrupt"
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 58531,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/Monitor",
|
||||
"event": "error",
|
||||
"error": "rpc error: code = Canceled desc = context canceled",
|
||||
"status": {
|
||||
"code": 1,
|
||||
"message": "context canceled"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 58532,
|
||||
"kind": "stderr",
|
||||
"data": {
|
||||
"lines": [
|
||||
"[loop] recv: rpc error: code = Canceled desc = context canceled\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 58532,
|
||||
"kind": "exit",
|
||||
"data": {
|
||||
"run_error": "recv: rpc error: code = Canceled desc = context canceled"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
96
cmd/loop/testdata/sessions/getinfo/01_loop-getinfo.json
vendored
Normal file
96
cmd/loop/testdata/sessions/getinfo/01_loop-getinfo.json
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
"metadata": {
|
||||
"args": [
|
||||
"/home/user/bin/loop",
|
||||
"getinfo",
|
||||
"--network",
|
||||
"regtest"
|
||||
],
|
||||
"env": {
|
||||
"HOME": "/home/user"
|
||||
},
|
||||
"version": "0.31.7-beta commit=v0.31.7-beta-28-g6d8ddfc59ddc2dcfd1a9b4e4b3c53a9cf15dd845 commit_hash=6d8ddfc59ddc2dcfd1a9b4e4b3c53a9cf15dd845",
|
||||
"duration": 200590737,
|
||||
"clock_start_unix": 1769407086
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"time_ms": 4,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/GetInfo",
|
||||
"event": "request",
|
||||
"message_type": "looprpc.GetInfoRequest",
|
||||
"payload": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 200,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/GetInfo",
|
||||
"event": "response",
|
||||
"message_type": "looprpc.GetInfoResponse",
|
||||
"payload": {
|
||||
"version": "0.31.7-beta",
|
||||
"network": "regtest",
|
||||
"rpc_listen": "localhost:11010",
|
||||
"rest_listen": "localhost:8081",
|
||||
"macaroon_path": "/home/user/.loop/regtest/loop.macaroon",
|
||||
"tls_cert_path": "/home/user/.loop/regtest/tls.cert",
|
||||
"loop_out_stats": {
|
||||
"pending_count": "0",
|
||||
"success_count": "0",
|
||||
"fail_count": "0",
|
||||
"sum_pending_amt": "0",
|
||||
"sum_succeeded_amt": "0"
|
||||
},
|
||||
"loop_in_stats": {
|
||||
"pending_count": "0",
|
||||
"success_count": "0",
|
||||
"fail_count": "0",
|
||||
"sum_pending_amt": "0",
|
||||
"sum_succeeded_amt": "0"
|
||||
},
|
||||
"commit_hash": "579ea31979e0cdb1ee6049ab97cc2768888eac40"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 200,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"{\n",
|
||||
" \"commit_hash\": \"579ea31979e0cdb1ee6049ab97cc2768888eac40\",\n",
|
||||
" \"loop_in_stats\": {\n",
|
||||
" \"fail_count\": \"0\",\n",
|
||||
" \"pending_count\": \"0\",\n",
|
||||
" \"success_count\": \"0\",\n",
|
||||
" \"sum_pending_amt\": \"0\",\n",
|
||||
" \"sum_succeeded_amt\": \"0\"\n",
|
||||
" },\n",
|
||||
" \"loop_out_stats\": {\n",
|
||||
" \"fail_count\": \"0\",\n",
|
||||
" \"pending_count\": \"0\",\n",
|
||||
" \"success_count\": \"0\",\n",
|
||||
" \"sum_pending_amt\": \"0\",\n",
|
||||
" \"sum_succeeded_amt\": \"0\"\n",
|
||||
" },\n",
|
||||
" \"macaroon_path\": \"/home/user/.loop/regtest/loop.macaroon\",\n",
|
||||
" \"network\": \"regtest\",\n",
|
||||
" \"rest_listen\": \"localhost:8081\",\n",
|
||||
" \"rpc_listen\": \"localhost:11010\",\n",
|
||||
" \"tls_cert_path\": \"/home/user/.loop/regtest/tls.cert\",\n",
|
||||
" \"version\": \"0.31.7-beta\"\n",
|
||||
"}\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 200,
|
||||
"kind": "exit",
|
||||
"data": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
103
cmd/loop/testdata/sessions/misc/01_loop-terms.json
vendored
Normal file
103
cmd/loop/testdata/sessions/misc/01_loop-terms.json
vendored
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
{
|
||||
"metadata": {
|
||||
"args": [
|
||||
"/home/user/bin/loop",
|
||||
"terms",
|
||||
"--network",
|
||||
"regtest"
|
||||
],
|
||||
"env": {
|
||||
"HOME": "/home/user"
|
||||
},
|
||||
"version": "0.31.7-beta commit=v0.31.7-beta-28-g6d8ddfc59ddc2dcfd1a9b4e4b3c53a9cf15dd845 commit_hash=6d8ddfc59ddc2dcfd1a9b4e4b3c53a9cf15dd845",
|
||||
"duration": 199188467,
|
||||
"clock_start_unix": 1769407086
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"time_ms": 7,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"Loop Out\n",
|
||||
"--------\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 7,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/LoopOutTerms",
|
||||
"event": "request",
|
||||
"message_type": "looprpc.TermsRequest",
|
||||
"payload": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 156,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/LoopOutTerms",
|
||||
"event": "response",
|
||||
"message_type": "looprpc.OutTermsResponse",
|
||||
"payload": {
|
||||
"min_swap_amount": "50000",
|
||||
"max_swap_amount": "1000000",
|
||||
"min_cltv_delta": 50,
|
||||
"max_cltv_delta": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 156,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"Amount: 50000 - 1000000\n",
|
||||
"Cltv delta: 50 - 250\n",
|
||||
"\n",
|
||||
"Loop In\n",
|
||||
"------\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 156,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/GetLoopInTerms",
|
||||
"event": "request",
|
||||
"message_type": "looprpc.TermsRequest",
|
||||
"payload": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 198,
|
||||
"kind": "grpc",
|
||||
"data": {
|
||||
"method": "/looprpc.SwapClient/GetLoopInTerms",
|
||||
"event": "response",
|
||||
"message_type": "looprpc.InTermsResponse",
|
||||
"payload": {
|
||||
"min_swap_amount": "50000",
|
||||
"max_swap_amount": "1000000"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 198,
|
||||
"kind": "stdout",
|
||||
"data": {
|
||||
"lines": [
|
||||
"Amount: 50000 - 1000000\n"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"time_ms": 199,
|
||||
"kind": "exit",
|
||||
"data": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue