From 1eb7edb0bbfda00d60a78b47143360d6fae93ee7 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 21 Jul 2021 15:08:20 +0930 Subject: [PATCH] pytest: test for offer failing decode when empty description. In particular, Shesek tried an empty offer description, and the resulting signature didn't match since it was omitted entirely from the bolt12 string! Reported-by: @shesek Signed-off-by: Rusty Russell --- tests/test_pay.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_pay.py b/tests/test_pay.py index 8108b67c4..64e92f3ad 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -3923,10 +3923,15 @@ def test_offer_needs_option(node_factory): l1.rpc.call('fetchinvoice', {'offer': 'aaaa'}) +@pytest.mark.xfail(strict=True) def test_offer(node_factory, bitcoind): plugin = os.path.join(os.path.dirname(__file__), 'plugins/currencyUSDAUD5000.py') l1 = node_factory.get_node(options={'plugin': plugin, 'experimental-offers': None}) + # Try empty description + ret = l1.rpc.call('offer', [9, '']) + l1.rpc.decode(ret['bolt12']) + bolt12tool = os.path.join(os.path.dirname(__file__), "..", "devtools", "bolt12-cli") # Try different amount strings for amount in ['1msat', '0.1btc', 'any', '1USD', '1.10AUD']: