MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_self_pay

Function test_self_pay

tests/test_renepay.py:412–426  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

410
411@pytest.mark.flaky(reruns=2)
412def test_self_pay(node_factory):
413 l1, l2 = node_factory.line_graph(2, wait_for_announce=True, opts={'allow-deprecated-apis': True})
414
415 inv = l1.rpc.invoice(10000, "test", "test")["bolt11"]
416 l1.rpc.call("renepay", {"invstring": inv})
417
418 # We can pay twice, no problem!
419 l1.rpc.call("renepay", {"invstring": inv})
420
421 inv2 = l1.rpc.invoice(10000, "test2", "test2")["bolt11"]
422 l1.rpc.delinvoice("test2", "unpaid")
423
424 with pytest.raises(RpcError, match=r"Unknown invoice") as excinfo:
425 l1.rpc.call("renepay", {"invstring": inv2})
426 assert excinfo.value.error["code"] == 203
427
428
429def test_fee_allocation(node_factory):

Callers

nothing calls this directly

Calls 4

line_graphMethod · 0.80
delinvoiceMethod · 0.80
invoiceMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected