Plugins: Add a test for the 'invoice_payment' notfication

This commit is contained in:
darosior
2019-07-21 14:08:33 +02:00
committed by ZmnSCPxj, ZmnSCPxj jxPCSmnZ
parent b5bb7f191f
commit 34533ead68
2 changed files with 26 additions and 0 deletions

View File

@@ -476,3 +476,21 @@ def test_warning_notification(node_factory):
l1.daemon.wait_for_log('plugin-pretend_badlog.py time: *')
l1.daemon.wait_for_log('plugin-pretend_badlog.py source: plugin-pretend_badlog.py')
l1.daemon.wait_for_log('plugin-pretend_badlog.py log: Test warning notification\\(for broken event\\)')
def test_invoice_payment_notification(node_factory):
"""
Test the 'invoice_payment' notification
"""
opts = [{}, {"plugin": "contrib/plugins/helloworld.py"}]
l1, l2 = node_factory.line_graph(2, opts=opts)
msats = 12345
preimage = '1' * 64
label = "a_descriptive_label"
inv1 = l2.rpc.invoice(msats, label, 'description', preimage=preimage)
l1.rpc.pay(inv1['bolt11'])
l2.daemon.wait_for_log(r"Received invoice_payment event for label {},"
" preimage {}, and amount of {}msat"
.format(label, preimage, msats))