test: Add tests to confirm that description is added to RPCs
What changed, and why it matters
This commit only adds new automated tests to verify that a user-provided description is returned by two existing RPC commands (disableoffer and enableoffer). It does not change any production code, fix a bug, or alter security behavior. There is no security issue in this change.
No security action needed. Review as normal test-only commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a test block in tests/test_pay.py that creates a BOLT12 offer with a description, then asserts that disableoffer and enableoffer return that description. The offer RPC itself is noted not to return the description. No implementation code is modified; this is purely test coverage expansion.
Changed components
tests/test_pay.pyInspect captured patch +14 / −0
diff --git a/tests/test_pay.py b/tests/test_pay.py
index f159689b..48abcb31 100644
--- a/tests/test_pay.py
+++ b/tests/test_pay.py
@@ -4492,6 +4492,20 @@ def test_offer(node_factory, bitcoind):
offer['bolt12']]).decode('UTF-8')
assert 'recurrence_optional: every 600 seconds limit 5\n' in output
+ # Test that description is returned in disableoffer and enableoffer
+ offer_desc = 'Test description returned'
+ ret = l1.rpc.call('offer', {'amount': '100000sat',
+ 'description': offer_desc})
+
+ # Description is not present in offer response
+ assert 'description' not in ret
+ # Description is returned in disableoffer
+ disable_ret = l1.rpc.call('disableoffer', {'offer_id': ret['offer_id']})
+ assert disable_ret['description'] == offer_desc
+ # Description is returned in enableoffer
+ enable_ret = l1.rpc.call('enableoffer', {'offer_id': ret['offer_id']})
+ assert enable_ret['description'] == offer_desc
+
def test_offer_deprecated_api(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
Why this scored 12/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.