Skip to content

Commit 2aa6bd1

Browse files
ShahanaFarooquierdoganishe
authored andcommitted
test: Add tests to confirm that description is added to RPCs
1 parent a090a50 commit 2aa6bd1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_pay.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4481,6 +4481,20 @@ def test_offer(node_factory, bitcoind):
44814481
offer['bolt12']]).decode('UTF-8')
44824482
assert 'recurrence_optional: every 600 seconds limit 5\n' in output
44834483

4484+
# Test that description is returned in disableoffer and enableoffer
4485+
offer_desc = 'Test description returned'
4486+
ret = l1.rpc.call('offer', {'amount': '100000sat',
4487+
'description': offer_desc})
4488+
4489+
# Description is not present in offer response
4490+
assert 'description' not in ret
4491+
# Description is returned in disableoffer
4492+
disable_ret = l1.rpc.call('disableoffer', {'offer_id': ret['offer_id']})
4493+
assert disable_ret['description'] == offer_desc
4494+
# Description is returned in enableoffer
4495+
enable_ret = l1.rpc.call('enableoffer', {'offer_id': ret['offer_id']})
4496+
assert enable_ret['description'] == offer_desc
4497+
44844498

44854499
def test_offer_deprecated_api(node_factory, bitcoind):
44864500
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})

0 commit comments

Comments
 (0)