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

This commit is contained in:
dni ⚡ 2025-06-30 14:51:34 +02:00
parent ab3248da15
commit c4c03d96a3
No known key found for this signature in database
GPG key ID: D1F416F29AD26E87
7 changed files with 128 additions and 53 deletions

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])