Skip to content

Expose PaidBolt12Invoice in bindings after UniFFI 0.29+ upgrade #757

@vincenzopalazzo

Description

@vincenzopalazzo

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+:

  1. Remove #[cfg(not(feature = "uniffi"))] from bolt12_invoice field in Event::PaymentSuccessful
  2. Add PaidBolt12Invoice as an [Enum] interface in bindings/ldk_node.udl
  3. Add StaticInvoice interface in bindings/ldk_node.udl
  4. Add the field back to PaymentSuccessful in the UDL
  5. Remove the duplicated impl_writeable_tlv_based_enum! macro in src/event.rs

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions