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

Function test_sendpay_notifications_nowaiter

tests/test_plugin.py:1749–1773  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

1747
1748
1749def test_sendpay_notifications_nowaiter(node_factory):
1750 opts = [{'plugin': os.path.join(os.getcwd(), 'tests/plugins/sendpay_notifications.py')},
1751 {},
1752 {'may_reconnect': False}]
1753 l1, l2, l3 = node_factory.line_graph(3, opts=opts, wait_for_announce=True)
1754 chanid23 = l2.get_channel_scid(l3)
1755 amount = 10**8
1756
1757 inv1 = l3.rpc.invoice(amount, "first", "desc")
1758 payment_hash1 = inv1['payment_hash']
1759 inv2 = l3.rpc.invoice(amount, "second", "desc")
1760 payment_hash2 = inv2['payment_hash']
1761 route = l1.single_route(l3.info['id'], amount)
1762
1763 l1.rpc.sendpay(route, payment_hash1, payment_secret=inv1['payment_secret'])
1764 l1.daemon.wait_for_log(r'Received a sendpay_success')
1765
1766 l2.rpc.close(chanid23, 1)
1767
1768 l1.rpc.sendpay(route, payment_hash2, payment_secret=inv2['payment_secret'])
1769 l1.daemon.wait_for_log(r'Received a sendpay_failure')
1770
1771 results = l1.rpc.call('listsendpays_plugin')
1772 assert len(results['sendpay_success']) == 1
1773 assert len(results['sendpay_failure']) == 1
1774
1775
1776def test_inline_plugin_wait_for_log_no_selfmatch(node_factory):

Callers

nothing calls this directly

Calls 9

joinMethod · 0.80
line_graphMethod · 0.80
get_channel_scidMethod · 0.80
single_routeMethod · 0.80
sendpayMethod · 0.80
wait_for_logMethod · 0.80
invoiceMethod · 0.45
closeMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected