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

Function test_invoice_payment_notification

tests/test_plugin.py:1532–1547  ·  view source on GitHub ↗

Test the 'invoice_payment' notification

(node_factory)

Source from the content-addressed store, hash-verified

1530
1531
1532def test_invoice_payment_notification(node_factory):
1533 """
1534 Test the 'invoice_payment' notification
1535 """
1536 opts = [{}, {"plugin": os.path.join(os.getcwd(), "contrib/plugins/helloworld.py")}]
1537 l1, l2 = node_factory.line_graph(2, opts=opts)
1538
1539 msats = 12345
1540 preimage = '1' * 64
1541 label = "a_descriptive_label"
1542 inv1 = l2.rpc.invoice(msats, label, 'description', preimage=preimage)
1543 l1.dev_pay(inv1['bolt11'], dev_use_shadow=False)
1544
1545 l2.daemon.wait_for_log(r"Received invoice_payment event for label {},"
1546 " preimage {}, and amount of {}"
1547 .format(label, preimage, msats))
1548
1549
1550def test_invoice_creation_notification(node_factory):

Callers

nothing calls this directly

Calls 5

joinMethod · 0.80
line_graphMethod · 0.80
wait_for_logMethod · 0.80
invoiceMethod · 0.45
dev_payMethod · 0.45

Tested by

no test coverage detected