Uh oh!
There was an error while loading. Please reload this page.
Expose Bolt11Invoice type in bindings - #522
Conversation
👋 Thanks for assigning @tnull as a reviewer! |
ldk-reviews-bot
commented
Apr 16, 2025
🔔 1st Reminder Hey @valentinewallace! This PR has been waiting for your review. |
tnull
left a comment
There was a problem hiding this comment.
Thanks for looking into this!
Approach looks already pretty good, some comments
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
6352b5d to
15153efComparetnull
commented
Apr 22, 2025
Please let me know when this is ready for another round of review! |
f2552f4 to
e2f37dfComparealexanderwiederin
commented
Apr 24, 2025
@tnull, when you have time, could you take another look? I believe the check failures are not related. |
e2f37df to
96fc245CompareThe first commit won't build on its own because of the function signatures in the bindings. Should I squash to one single commit? |
tnull
left a comment
There was a problem hiding this comment.
Excuse the delay here! Generally looks good, just two minor comments.
The first commit won't build on its own because of the function signatures in the bindings. Should I squash to one single commit?
Yes, if the commits don't build by themselves, it's preferable to squash, thank you!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a210c5e to
efe36fbCompare422a81b to
0efa3f9Compareldk-reviews-bot
commented
May 3, 2025
🔔 1st Reminder Hey @tnull! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 5, 2025
🔔 2nd Reminder Hey @tnull! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 7, 2025
🔔 3rd Reminder Hey @tnull! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 10, 2025
🔔 4th Reminder Hey @tnull! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 12, 2025
🔔 5th Reminder Hey @tnull! This PR has been waiting for your review. |
tnull
left a comment
There was a problem hiding this comment.
Excuse the delay here!
This basically looks good to me, just one comment that needs to be addressed, the DRYing up can happen in any of the follow-up PRs.
Uh oh!
There was an error while loading. Please reload this page.
| type Bolt11Invoice = Arc<crate::uniffi_types::Bolt11Invoice>; | ||
| #[cfg(not(feature = "uniffi"))] | ||
| pub(crate) fn maybe_wrap_invoice(invoice: LdkBolt11Invoice) -> Bolt11Invoice { |
There was a problem hiding this comment.
I'm starting to wonder if we really need type-dependant methods for everything we wrap. I think we should look to DRY them up, e.g., to be reused for Offer,Bolt12Invoice, Refund, etc.
Probably fine to leave as-is here, but in the next PR we should start DRYing the wrapping code where we can (i.e., will probably also make sense to move these to uniffi_types then).
There was a problem hiding this comment.
Yea, good point. Will try a couple of things for the types to come
Implement Bolt11Invoice struct in uniffi_types to provide a wrapper around LDK's Bolt11Invoice for cross-language bindings. Modified payment handling in bolt11.rs to: - Support both native and FFI-compatible invoice types via type aliasing - Add maybe_wrap_invoice and maybe_convert_invoice helper functions - Implement conditional compilation for transparent FFI support - Update all payment functions to handle wrapped invoice types Integrated with unified_qr.rs to ensure consistent invoice handling across the QR code generation and payment workflows. Functionality tested with test coverage to ensure that data does not change when wrapping/unwrapping.
0efa3f9 to
f8e758dCompare
First PR for #504.
This PR converts Bolt11Invoice from a string typedef to a full interface in the UDL, providing direct access to invoice properties across language bindings.
The scope has been limited to primitive properties for simplicity, with plans to extend the interface in future PRs.
Changes
Benefits