xpay: tests should expect the new error messages
What changed, and why it matters
This commit only updates test files so that automated checks expect slightly different error wording from the xpay payment command. It does not change any production code, so it cannot introduce a security vulnerability or fix one on its own.
No security action needed; treat as ordinary test maintenance. If reviewing a series, verify the companion commit that changed the actual xpay error messages for correctness.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies pytest assertions in tests/test_pay.py and tests/test_xpay.py to match new xpay error-message strings. No C/lightningd/plugin source code is touched. The change is purely a test-suite synchronization after an earlier user-facing message change.
Changed components
tests/test_pay.pytests/test_xpay.pyInspect captured patch +24 / −3
diff --git a/tests/test_pay.py b/tests/test_pay.py
index b211a1c0..ba9561a2 100644
--- a/tests/test_pay.py
+++ b/tests/test_pay.py
@@ -5199,7 +5199,7 @@ gives a routehint straight to us causes an issue
== only_one(l3.rpc.listpeerchannels()['channels'])['alias']['remote'])
l3.stop()
- with pytest.raises(RpcError, match=r'Failed: We could not find a usable set of paths. All 1 channels to the destination are disabled.'):
+ with pytest.raises(RpcError, match=r'Failed: We could not find a usable set of paths.'):
l2.rpc.xpay(inv)
diff --git a/tests/test_xpay.py b/tests/test_xpay.py
index eae28776..1568438f 100644
--- a/tests/test_xpay.py
+++ b/tests/test_xpay.py
@@ -199,11 +199,32 @@ def test_xpay_simple(node_factory):
# Failure from l3 (with routehint)
l4.stop()
- with pytest.raises(RpcError, match=r"Failed after 1 attempts\. We got temporary_channel_failure for the invoice's route hint \([0-9x]*/[01]\), assuming it can't carry 10000msat\. Then routing failed: We could not find a usable set of paths\. The shortest path is [0-9x]*->[0-9x]*->[0-9x]*, but [0-9x]*/[01]\ layer xpay-15 says max is 9999msat"):
+ with pytest.raises(
+ RpcError,
+ match=(
+ r"Failed after 1 attempts\. "
+ r"We got temporary_channel_failure for the invoice's route hint \([0-9x]*/[01]\), "
+ r"assuming it can't carry 10000msat\. "
+ r"Then routing failed: We could not find a usable set of paths\. "
+ r"We know from xpay-15 that destination has maximum "
+ r"capacity 9999msat \(in 1 channels\)\."
+ ),
+ ):
l1.rpc.xpay(b11)
# Failure from l3 (with blinded path)
- with pytest.raises(RpcError, match=r"Failed after 1 attempts. We got an error from inside the blinded path 0x0x0/1: we assume it means insufficient capacity. Then routing failed: We could not find a usable set of paths. The shortest path is [0-9x]*->[0-9x]*->0x0x0, but 0x0x0/1 layer xpay-17 says max is 99999msat"):
+ with pytest.raises(
+ RpcError,
+ match=(
+ r"Failed after 1 attempts\. "
+ r"We got an error from inside the blinded path 0x0x0/1: "
+ r"we assume it means insufficient capacity\. "
+ r"Then routing failed: "
+ r"We could not find a usable set of paths\. "
+ r"We know from xpay-17 that destination has maximum "
+ r"capacity 99999msat \(in 1 channels\)\."
+ ),
+ ):
l1.rpc.xpay(b12)
# Restart, try pay already paid one again.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.