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

Function test_htlc_accepted_hook_resolve

tests/test_plugin.py:1253–1267  ·  view source on GitHub ↗

l3 creates an invoice, l2 knows the preimage and will shortcircuit.

(node_factory)

Source from the content-addressed store, hash-verified

1251
1252
1253def test_htlc_accepted_hook_resolve(node_factory):
1254 """l3 creates an invoice, l2 knows the preimage and will shortcircuit.
1255 """
1256 l1, l2, l3 = node_factory.line_graph(3, opts=[
1257 {},
1258 {'plugin': os.path.join(os.getcwd(), 'tests/plugins/shortcircuit.py')},
1259 {}
1260 ], wait_for_announce=True)
1261
1262 inv = l3.rpc.invoice(amount_msat=1000, label="lbl", description="desc", preimage="00" * 32)['bolt11']
1263 l1.rpc.xpay(inv)
1264
1265 # And the invoice must still be unpaid
1266 inv = l3.rpc.listinvoices("lbl")['invoices']
1267 assert len(inv) == 1 and inv[0]['status'] == 'unpaid'
1268
1269
1270def test_htlc_accepted_hook_direct_restart(node_factory, executor):

Callers

nothing calls this directly

Calls 5

line_graphMethod · 0.80
joinMethod · 0.80
invoiceMethod · 0.45
xpayMethod · 0.45
listinvoicesMethod · 0.45

Tested by

no test coverage detected