test: add regtest testcase for no route failure (#3189)

This commit is contained in:
dni ⚡
2025-06-30 14:51:34 +02:00
committed by GitHub
parent 974ee26224
commit f4dbd369be
7 changed files with 128 additions and 53 deletions
+17
View File
@@ -39,6 +39,17 @@ docker_lightning_unconnected_cli = [
]
docker_lightning_noroute_cli = [
"docker",
"exec",
"lnbits-lnd-4-1",
"lncli",
"--network",
"regtest",
"--rpcserver=lnd-4",
]
def run_cmd(cmd: list) -> str:
timeout = 10
process = Popen(cmd, stdout=PIPE, stderr=PIPE)
@@ -100,6 +111,12 @@ def get_real_invoice(sats: int) -> dict:
return run_cmd_json(cmd)
def get_real_invoice_noroute(sats: int) -> dict:
cmd = docker_lightning_noroute_cli.copy()
cmd.extend(["addinvoice", str(sats)])
return run_cmd_json(cmd)
def pay_real_invoice(invoice: str) -> str:
cmd = docker_lightning_cli.copy()
cmd.extend(["payinvoice", "--force", invoice])