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

Function test_htlcmax0

tests/test_renepay.py:653–698  ·  view source on GitHub ↗

Topology: 1----2----4 | | 3----5----6 Tests the plugin when some routes have htlc_max=0.

(node_factory)

Source from the content-addressed store, hash-verified

651
652
653def test_htlcmax0(node_factory):
654 """
655 Topology:
656 1----2----4
657 | |
658 3----5----6
659 Tests the plugin when some routes have htlc_max=0.
660 """
661 opts = [
662 {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
663 {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
664 {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
665 {
666 "disable-mpp": None,
667 "fee-base": 0,
668 "fee-per-satoshi": 0,
669 "htlc-maximum-msat": 0,
670 'allow-deprecated-apis': True,
671 },
672 {
673 "disable-mpp": None,
674 "fee-base": 0,
675 "fee-per-satoshi": 0,
676 "htlc-maximum-msat": 800000000,
677 'allow-deprecated-apis': True,
678 },
679 {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
680 ]
681 l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts)
682 start_channels(
683 [
684 (l1, l2, 10000000),
685 (l2, l4, 1000000),
686 (l4, l6, 1000000),
687 (l1, l3, 10000000),
688 (l3, l5, 1000000),
689 (l5, l6, 1000000),
690 ]
691 )
692
693 inv = l6.rpc.invoice("600000sat", "inv", "description")
694
695 l1.rpc.call("renepay", {"invstring": inv["bolt11"]})
696 l1.wait_for_htlcs()
697 invoice = only_one(l6.rpc.listinvoices("inv")["invoices"])
698 assert invoice["amount_received_msat"] >= Millisatoshi("600000sat")
699
700
701def test_concurrency(node_factory):

Callers

nothing calls this directly

Calls 8

only_oneFunction · 0.90
MillisatoshiClass · 0.90
start_channelsFunction · 0.85
get_nodesMethod · 0.80
wait_for_htlcsMethod · 0.80
invoiceMethod · 0.45
callMethod · 0.45
listinvoicesMethod · 0.45

Tested by

no test coverage detected