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

Function test_invoice_payment_hook_hold

tests/test_plugin.py:713–727  ·  view source on GitHub ↗

l1 uses the hold_invoice plugin to delay invoice payment.

(node_factory, executor)

Source from the content-addressed store, hash-verified

711
712
713def test_invoice_payment_hook_hold(node_factory, executor):
714 """ l1 uses the hold_invoice plugin to delay invoice payment.
715 """
716 opts = [{}, {'plugin': os.path.join(os.getcwd(), 'tests/plugins/hold_invoice.py')}]
717 l1, l2 = node_factory.line_graph(2, opts=opts)
718
719 inv1 = l2.rpc.invoice(1230, 'label', 'description', preimage='1' * 64)
720
721 # This should block.
722 f = executor.submit(l1.rpc.xpay, inv1['bolt11'])
723 time.sleep(5)
724 assert not f.done()
725
726 open(os.path.join(l2.daemon.lightning_dir, TEST_NETWORK, "unhold"), "w").close()
727 f.result(TIMEOUT)
728
729
730@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
line_graphMethod · 0.80
invoiceMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected