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

Function test_delpay_mixed_status

tests/test_pay.py:4122–4141  ·  view source on GitHub ↗

One failure, one success; we only want to delete the failed one!

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

4120
4121
4122def test_delpay_mixed_status(node_factory, bitcoind):
4123 """
4124 One failure, one success; we only want to delete the failed one!
4125 """
4126 l1, l2, l3 = node_factory.line_graph(3, fundamount=10**5,
4127 wait_for_announce=True)
4128 # Expensive route!
4129 l4 = node_factory.get_node(options={'fee-per-satoshi': 1000,
4130 'fee-base': 2000})
4131 node_factory.join_nodes([l1, l4, l3], wait_for_announce=True)
4132
4133 # Don't give a hint, so l1 chooses cheapest.
4134 inv = l3.dev_invoice(10**5, 'lbl', 'desc', dev_routes=[])
4135 l3.rpc.disconnect(l2.info['id'], force=True)
4136 l1.rpc.pay(inv['bolt11'])
4137
4138 assert len(l1.rpc.listsendpays()['payments']) == 2
4139 delpay_result = l1.rpc.delpay(inv['payment_hash'], 'failed')['payments']
4140 assert len(delpay_result) == 1
4141 assert len(l1.rpc.listsendpays()['payments']) == 1
4142
4143
4144@pytest.mark.parametrize("keysendcmd", ["keysend", "xkeysend"])

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