From e8f9366a29de3514524675b9752ce6c329ad8069 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 31 Jan 2023 10:46:09 +1030 Subject: [PATCH] pytest: add test for using offers with allow-deprecated-apis=True Demonstrates that offers doesn't handle msat fields correctly. Reported-by: @SimonVrouwe Signed-off-by: Rusty Russell --- tests/test_pay.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_pay.py b/tests/test_pay.py index 991cc8074..ce1d5b8de 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -4556,6 +4556,20 @@ def test_offer(node_factory, bitcoind): assert 'recurrence: every 600 seconds paywindow -10 to +600 (pay proportional)\n' in output +@pytest.mark.xfail(strict=True) +def test_offer_deprecated_api(node_factory, bitcoind): + l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None, + 'allow-deprecated-apis': True}) + + offer = l2.rpc.call('offer', {'amount': '2msat', + 'description': 'test_offer_deprecated_api'}) + inv = l1.rpc.call('fetchinvoice', {'offer': offer['bolt12']}) + + # Deprecated fields make schema checker upset. + l1.rpc.jsonschemas = {} + l1.rpc.pay(inv['invoice']) + + @pytest.mark.developer("dev-no-modern-onion is DEVELOPER-only") def test_fetchinvoice_3hop(node_factory, bitcoind): l1, l2, l3, l4 = node_factory.line_graph(4, wait_for_announce=True,