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

Function test_hardmpp2

tests/test_renepay.py:778–801  ·  view source on GitHub ↗

Credits to @daywalker90 for this test case.

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

776
777@unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "broken for some reason")
778def test_hardmpp2(node_factory, bitcoind):
779 """Credits to @daywalker90 for this test case."""
780 opts = {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 10, 'allow-deprecated-apis': True}
781 l1, l2, l3 = node_factory.get_nodes(3, opts=opts)
782 start_channels(
783 [
784 (l1, l2, 100_000),
785 (l1, l2, 200_000),
786 (l1, l2, 300_000),
787 (l1, l2, 400_000),
788 (l2, l3, 100_000),
789 (l2, l3, 200_000),
790 (l2, l3, 300_000),
791 (l2, l3, 600_000),
792 ]
793 )
794 # FIXME: changing the last channel from 600k to 400k will fail the test due
795 # to l2 not accepting to forward any amount above 200k with error:
796 # CHANNEL_ERR_CHANNEL_CAPACITY_EXCEEDED, still investigating
797 inv = l3.rpc.invoice("800000sat", "inv", "description")
798 l1.rpc.call("renepay", {"invstring": inv["bolt11"]})
799 l1.wait_for_htlcs()
800 receipt = only_one(l3.rpc.listinvoices("inv")["invoices"])
801 assert receipt["amount_received_msat"] == Millisatoshi("800000sat")
802
803
804def test_description(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