Summary
The bolt12_invoice field in the PaymentSuccessful event is currently not exposed in FFI bindings due to a UniFFI limitation.
Background
PR #733 adds PaidBolt12Invoice to the PaymentSuccessful event to enable proof of payment for BOLT12 transactions. However, UniFFI v0.28 does not support Object types in enum variant data:
Objects cannot currently be used in enum variant data
This limitation was resolved in uniffi-rs#2412, which shipped in UniFFI v0.29.
Why we can't upgrade yet
We currently can't upgrade to UniFFI v0.29 because NordSecurity/uniffi-bindgen-go lags behind and doesn't support newer versions yet. See: NordSecurity/uniffi-bindgen-go#40
Action needed
Once we can upgrade to UniFFI 0.29+:
- Remove
#[cfg(not(feature = "uniffi"))] from bolt12_invoice field in Event::PaymentSuccessful
- Add
PaidBolt12Invoice as an [Enum] interface in bindings/ldk_node.udl
- Add
StaticInvoice interface in bindings/ldk_node.udl
- Add the field back to
PaymentSuccessful in the UDL
- Remove the duplicated
impl_writeable_tlv_based_enum! macro in src/event.rs
Related