bolt12: Add test vector for missing offer_amount with offer_currency
During differential fuzzing between C-lightning and rust-lightning, discovered that C-lightning incorrectly accepts offers with offer_currency set but offer_amount missing, while rust-lightning rejects them.
The BOLT 12 specification states in "Requirements For Offers":
if
offer_currencyis set andoffer_amountis not set:
- MUST NOT respond to the offer.
This pr adds a test vector for the invalid offer:
lno1qcp4256ypgx9getnwss8vetrw3hhyuckyypwa3eyt44h6txtxquqh7lz5djge4afgfjn7k4rgrkuag0jsd5xvxg
Which contains CURRENCY=USD but no amount field, and should be rejected by all compliant implementations.
I got this test vector from: https://github.com/ElementsProject/lightning/blob/c3362b057c2174589024254f4cab9eb8d955a26f/common/test/run-bolt12-encode-test.c#L439
Thanks. Eclair too fails this test, I've fixed it in https://github.com/ACINQ/eclair/pull/3140.
@rustyrussell could you fix this on the cln side and verify this test vector?