Commit graph

82 commits

Author SHA1 Message Date
Matt Corallo
d782df01ba
Merge pull request #901 from jkczyz/2021-04-invoice-feature-semantics
Hide InvoiceFeatures behind InvoiceBuilder API
2021-05-04 02:00:52 +00:00
Jeffrey Czyz
2226ae292b
Test feature bit semantics in Invoice::from_signed 2021-05-03 16:23:28 -07:00
Jeffrey Czyz
0592c52f23
Test feature bits in InvoiceBuilder 2021-05-03 16:23:28 -07:00
Jeffrey Czyz
20e776bc8e
Add basic_mpp support to InvoiceBuilder
Since InvoiceFeatures are an implementation detail of InvoiceBuilder, an
explicit call is needed to support the basic_mpp feature. Since it is
dependent on the payment_secret feature, conditionally define the
builder's method only when payment_secret has been set.
2021-05-03 16:23:27 -07: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
f551d5946b Bump versions to 0.0.14, lightning-invoice 0.5 2021-05-01 00:43:15 +00:00
Matt Corallo
83ab933f35 Add a not-exported tag to the Display implementation for RawHrp
RawHrp is already not-exported, so implementations for it should be
as well.
2021-05-01 00:36:58 +00:00
Matt Corallo
aed4665d44 Use explicit import lists instead of glob imports in invoice
While this is less readable, I spent way too long trying to adapt
the bindings generation code to handle glob imports and concluded
it would take refactoring almost the entire import-resolution
logic. While this may be a good refactor to do eventually, its
probably not worth it today.
2021-05-01 00:36:58 +00:00
Matt Corallo
2242b621fd Skip TaggedField for now as enum { A(A) } is broken in Java
... due to A and A aliasing each other.
2021-04-30 19:00:50 +00:00
Matt Corallo
246493f300 Set default error type for SignOrCreationError for bindings
The C bindings generator now looks to default generic types as the
way to map a struct or enum parameter. Because SignOrCreationError
is only used directly with an error type of `()`, we set that to
the default and assume no other error types are needed.
2021-04-30 19:00:50 +00:00
Matt Corallo
b9a934ee92 Deny broken doc links in lightning-invoice as well 2021-04-30 17:33:05 +00:00
Matt Corallo
8cde7e8db9 Fix merge conflicts between #898 and #895. 2021-04-30 17:32:36 +00: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
4c7be7e137
Add utility to create an invoice using the ChannelManager
This also allows the ChannelManager to track information for inbound payments
to check the PaymentSecret on receive.
2021-04-29 19:13:36 -04: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
aafa741f29
Test default invoice field values 2021-04-29 14:08:42 -07:00
Jeffrey Czyz
383ebc0406
Require min_final_cltv_expiry in invoice 2021-04-29 14:08:41 -07:00
Jeffrey Czyz
e0ec016817
Use default for invoice's min_final_cltv_expiry 2021-04-29 14:08:41 -07:00
Jeffrey Czyz
25a3e041d9
Use constant for invoice's default expiry value 2021-04-29 14:04:12 -07:00
Matt Corallo
2484c1afc2 Add no-export tags for lightning-invoice where we can't map to C 2021-04-29 15:48:16 +00:00
Matt Corallo
3d3147fe83 Rename lightning_invoice::Signature to InvoiceSignature
This prevents aliasing the global secp256k1::Signature name in C
bindings and also makes it a little more explicit that the object
is different from other signature types.
2021-04-29 15:48:16 +00:00
Matt Corallo
236342332e Do not return a reference to a u64 in rust-lightning-invoices
There is generally never a reason to return a non-mutable reference
to a u64 vs just copying it, same applies here. It makes the API
slightly less consistent, but is easier to map in bindings and just
makes more sense.
2021-04-29 15:48:16 +00:00
Valentine Wallace
b24d02c6a2
Add Features feature to invoices. 2021-04-26 12:29:46 -04:00
Valentine Wallace
2cbe4a09ec
Fix indentation in payment_secret function 2021-04-23 17:11:40 -04:00
Valentine Wallace
a62a71cb52
invoice: rename Route to RouteHint (which is more accurate) 2021-04-20 16:26:56 -04:00
Valentine Wallace
ad900658ce
Rename RouteHint to RouteHintHop (which is more accurate) 2021-04-20 16:26:56 -04:00
Valentine Wallace
21cb8db1b6
invoice: swap RouteHop for RouteHint
To prevent naming conflicts in bindings
2021-04-20 16:26:52 -04:00
Valentine Wallace
c3d25ed4bd
Fix Windows 2021-04-09 10:08:27 -04:00
Valentine Wallace
741f118da4
Clean up lightning-invoice Cargo.toml and README 2021-04-09 10:08:27 -04:00
Valentine Wallace
56069ba7aa
Clean up lightning-invoice CI, license, and add to workspaces 2021-04-09 10:08:27 -04: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