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

Function test_invoice_payment_notification

tests/test_plugin.py:1448–1463  ·  view source on GitHub ↗

Test the 'invoice_payment' notification

(node_factory)

Source from the content-addressed store, hash-verified

1446
1447
1448def test_invoice_payment_notification(node_factory):
1449 """
1450 Test the 'invoice_payment' notification
1451 """
1452 opts = [{}, {"plugin": os.path.join(os.getcwd(), "contrib/plugins/helloworld.py")}]
1453 l1, l2 = node_factory.line_graph(2, opts=opts)
1454
1455 msats = 12345
1456 preimage = '1' * 64
1457 label = "a_descriptive_label"
1458 inv1 = l2.rpc.invoice(msats, label, 'description', preimage=preimage)
1459 l1.dev_pay(inv1['bolt11'], dev_use_shadow=False)
1460
1461 l2.daemon.wait_for_log(r"Received invoice_payment event for label {},"
1462 " preimage {}, and amount of {}"
1463 .format(label, preimage, msats))
1464
1465
1466def 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