Commit graph

22 commits

Author SHA1 Message Date
Wilmer Paulino
ec928d55b4
Bump rust-bitcoin to v0.30.2 2023-11-22 15:58:01 -08:00
Jeffrey Czyz
62ca48f979
Qualify the BOLT 11 semantic error type
A previous commit qualified the BOLT 12 semantic error type. Qualify the
BOLT 11 semantic error type for consistency.
2023-07-14 15:06:17 -05:00
Jeffrey Czyz
6fb34d30b3
Qualify the BOLT 11 parse error type
A previous commit qualified the BOLT 12 parse error type. Qualify the
BOLT 11 parse error type for consistency.
2023-07-14 15:06:17 -05:00
Jeffrey Czyz
4c383a39a8
Qualify the BOLT 11 raw invoice types
A previous commit qualified the BOLT 11 invoice type, so any related
types should be similarly qualified, if public.
2023-07-14 15:06:10 -05:00
Jeffrey Czyz
93ead4aec5
Qualify the BOLT 11 invoice type
A previous commit qualified the BOLT 12 invoice type. Qualify the BOLT
11 invoice type for consistency.
2023-07-14 15:05:11 -05:00
Matt Corallo
8ed6e64913 Support setting the new payment metadata field in invoices
This adds support for setting the new payment metadata field in
BOLT11 invoices, using a new type flag on the builder to enforce
transition correctness.

We allow users to set the payment metadata as either optional or
required, defaulting to optional so that invoice parsing does not
fail if the sender does not support payment metadata fields.
2023-04-19 02:57:19 +00:00
Paul Miller
cf0a90b8c0
Fallback: add Address getter and use bitcoin types 2023-04-06 10:49:14 -05:00
Duncan Dean
fb10fc9590
Add _delta suffix to min_final_cltv_expiry
This matches the spec and helps avoid any confusion around
naming. We're also then consistent with `cltv_expiry` in an HTLC being
the actual block height value for the CLTV and not a delta.
2023-01-24 13:07:23 +02:00
Jeffrey Czyz
574870e9f8
Move network_graph.rs to gossip.rs
The routing::network_graph module contains a few structs related to p2p
gossip. So renaming the module to 'gossip' seems more appropriate.
2022-06-02 15:15:30 -07:00
Devrandom
28d33ff9e0 bitcoin crate 0.28.1 2022-05-05 18:04:42 +02:00
Devrandom
01915810d4 Adapt lightning-invoice to no_std 2022-01-05 23:18:03 +01:00
Matt Corallo
a906c498fb Use new BOLT 11 test vectors with payment_secrets and feature flags
This pulls the BOLT 11 test vectors from
https://github.com/lightningnetwork/lightning-rfc/pull/898,
tweaking our tests to properly handle them.
2021-08-31 21:29:51 +00:00
Matt Corallo
a4a54ed9df Check if invoices contain unknown required features
This adds the final missing BOLT 11 failure test, checking for
unknown required feature flags before accepting an invoice.
2021-08-31 21:29:51 +00:00
Matt Corallo
0be428eeda Convert the invoice creation API to millisats and req it for parse
The BOLT 11 invalid invoice test vectors suggest failing to parse
invoices which have an amount which is not a whole number of
millisatoshis. lightning-invoice, however, happily parses such
invoices. While we could continue to parse them, failing them makes
for one less check on the user code side, so we might as well.

In order to keep the invoice creation less likely to fail, we also
switch the Builder amount-setting function to use millisatoshis.
2021-08-31 21:29:51 +00:00
Matt Corallo
181cb1103d [invoice] Fix non-recoverable sig handling and bogus SI prefix err
This adds two additional tests from the BOLT 11 invalid invoice
tests, fixing the two errors that broke them. It fixes a panic on
the "nonrecoverable signature" test and makes the error variant
more sensible on the bogus SI prefix test.
2021-08-31 21:29:51 +00:00
Matt Corallo
a80819c9c2 [invoice] Add the BOLT 11 failure unit tests that we already pass 2021-08-31 21:29:51 +00:00
Jeffrey Czyz
b5f0ebab77
Hide InvoiceFeatures behind InvoiceBuilder API
Instead of relying on users to set an invoice's features correctly,
enforce the semantics inside InvoiceBuilder. For instance, if the user
sets a PaymentSecret then InvoiceBuilder should ensure the appropriate
feature bits are set. Thus, for this example, the TaggedField
abstraction can be retained while still ensuring BOLT 11 semantics at
the builder abstraction.
2021-05-03 16:23:24 -07:00
Matt Corallo
47cb2939c8
Merge pull request #898 from jkczyz/2021-04-invoice-expiry
Require min_final_cltv_expiry in invoices
2021-04-30 17:25:59 +00:00
Valentine Wallace
f24bbd63cc
Move PaymentPreimage+PaymentHash+PaymentSecret to top-level ln module 2021-04-29 18:39:47 -04:00
Valentine Wallace
9529226adf
invoice: swap PaymentSecret for ChannelManager's PaymentSecret 2021-04-29 18:39:47 -04:00
Jeffrey Czyz
383ebc0406
Require min_final_cltv_expiry in invoice 2021-04-29 14:08:41 -07:00
Sebastian
f00bb10a82
Pure import of lightning-invoice crate
Original repo: https://github.com/rust-bitcoin/rust-lightning-invoice
2021-04-09 10:08:27 -04:00