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

Function test_invoice_creation_notification

tests/test_plugin.py:1550–1564  ·  view source on GitHub ↗

Test the 'invoice_creation' notification

(node_factory)

Source from the content-addressed store, hash-verified

1548
1549
1550def test_invoice_creation_notification(node_factory):
1551 """
1552 Test the 'invoice_creation' notification
1553 """
1554 opts = [{}, {"plugin": os.path.join(os.getcwd(), "contrib/plugins/helloworld.py")}]
1555 l1, l2 = node_factory.line_graph(2, opts=opts)
1556
1557 msats = 12345
1558 preimage = '1' * 64
1559 label = "a_descriptive_label"
1560 l2.rpc.invoice(msats, label, 'description', preimage=preimage)
1561
1562 l2.daemon.wait_for_log(r"Received invoice_creation event for label {},"
1563 " preimage {}, and amount of {}"
1564 .format(label, preimage, msats))
1565
1566
1567def test_channel_opened_notification(node_factory):

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected