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

Function test_error_messages

tests/test_xpay.py:1356–1370  ·  view source on GitHub ↗

Nicer error messages when we disable the only channel to the destination.

(node_factory)

Source from the content-addressed store, hash-verified

1354
1355
1356def test_error_messages(node_factory):
1357 """Nicer error messages when we disable the only channel to the destination."""
1358 plugin = os.path.join(os.path.dirname(__file__), 'plugins/replace_payload.py')
1359 l1, l2 = node_factory.line_graph(
1360 2,
1361 opts=[{}, {"plugin": plugin}],
1362 wait_for_announce=True
1363 )
1364
1365 # Replace with an invalid payload.
1366 l2.rpc.call('setpayload', ['0000'])
1367 inv = l2.rpc.invoice(123, 'test_error_messages', 'test_error_messages')['bolt11']
1368 scidd = first_scidd(l1, l2)
1369 with pytest.raises(RpcError, match=rf"Failed after 1 attempts\. Unexpected error \(invalid_onion_payload\) from final node: disabling {scidd} for this payment\. Then routing failed: We could not find a usable set of paths\. All 1 channels to the source are disabled."):
1370 l1.rpc.xpay(inv)
1371
1372
1373def test_blinded_path_fees(node_factory):

Callers

nothing calls this directly

Calls 6

first_sciddFunction · 0.90
joinMethod · 0.80
line_graphMethod · 0.80
callMethod · 0.45
invoiceMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected