mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
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 <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
ce338dc88f
commit
1eb7edb0bb
@@ -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']:
|
||||
|
||||
Reference in New Issue
Block a user