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

Function test_delpay_works

tests/test_pay.py:5540–5567  ·  view source on GitHub ↗

One failure, one success; deleting the success works (groupid=1, partid=2)

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

5538
5539
5540def test_delpay_works(node_factory, bitcoind):
5541 """
5542 One failure, one success; deleting the success works (groupid=1, partid=2)
5543 """
5544 l1, l2, l3 = node_factory.line_graph(3, fundamount=10**5,
5545 wait_for_announce=True)
5546 # Expensive route!
5547 l4 = node_factory.get_node(options={'fee-per-satoshi': 1000,
5548 'fee-base': 2000})
5549 node_factory.join_nodes([l1, l4, l3], wait_for_announce=True)
5550
5551 # Don't give a hint, so l1 chooses cheapest.
5552 inv = l3.dev_invoice(10**5, 'lbl', 'desc', dev_routes=[])
5553 l3.rpc.disconnect(l2.info['id'], force=True)
5554 l1.rpc.pay(inv['bolt11'])
5555
5556 assert len(l1.rpc.listsendpays()['payments']) == 2
5557 failed = [p for p in l1.rpc.listsendpays()['payments'] if p['status'] == 'complete'][0]
5558 l1.rpc.delpay(payment_hash=failed['payment_hash'],
5559 status=failed['status'],
5560 groupid=failed['groupid'],
5561 partid=failed['partid'])
5562
5563 with pytest.raises(RpcError, match=r'No payment for that payment_hash'):
5564 l1.rpc.delpay(payment_hash=failed['payment_hash'],
5565 status=failed['status'],
5566 groupid=failed['groupid'],
5567 partid=failed['partid'])
5568
5569
5570def test_fetchinvoice_with_no_quantity(node_factory):

Callers

nothing calls this directly

Calls 7

line_graphMethod · 0.80
join_nodesMethod · 0.80
dev_invoiceMethod · 0.80
listsendpaysMethod · 0.80
get_nodeMethod · 0.45
disconnectMethod · 0.45
payMethod · 0.45

Tested by

no test coverage detected