mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +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:
parent
ce338dc88f
commit
1eb7edb0bb
1 changed files with 5 additions and 0 deletions
|
@ -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']:
|
||||
|
|
Loading…
Add table
Reference in a new issue