From 520e5aa05f686b5ffd365f1769d96bbe26a0b08c Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Tue, 10 Jun 2025 13:37:02 +0200 Subject: [PATCH] Export trait impls in FFI Previously, we moved from a `String` representation to a 'full' `Bolt11Invoice` type. However, we forgot to expose the `Display` implementation in the FFI, leaving now way to retrieve the invoice string. Here, we fix this oversight, and also make a few related changes. --- bindings/ldk_node.udl | 1 + src/ffi/types.rs | 2 +- src/payment/unified_qr.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bindings/ldk_node.udl b/bindings/ldk_node.udl index 505f0db8d..e914fd00e 100644 --- a/bindings/ldk_node.udl +++ b/bindings/ldk_node.udl @@ -715,6 +715,7 @@ dictionary RouteHintHop { RoutingFees fees; }; +[Traits=(Debug, Display, Eq)] interface Bolt11Invoice { [Throws=NodeError, Name=from_str] constructor([ByRef] string invoice_str); diff --git a/src/ffi/types.rs b/src/ffi/types.rs index bbf730211..d35f2aa2e 100644 --- a/src/ffi/types.rs +++ b/src/ffi/types.rs @@ -926,7 +926,7 @@ impl From for RouteHintHop { /// Represents a syntactically and semantically correct lightning BOLT11 invoice. #[derive(Debug, Clone, PartialEq, Eq)] pub struct Bolt11Invoice { - pub inner: LdkBolt11Invoice, + pub(crate) inner: LdkBolt11Invoice, } impl Bolt11Invoice { diff --git a/src/payment/unified_qr.rs b/src/payment/unified_qr.rs index 125e1d09b..af5ee1c7b 100644 --- a/src/payment/unified_qr.rs +++ b/src/payment/unified_qr.rs @@ -188,6 +188,7 @@ impl UnifiedQrPayment { /// [BIP 21]: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki /// [`PaymentId`]: lightning::ln::channelmanager::PaymentId /// [`Txid`]: bitcoin::hash_types::Txid +#[derive(Debug)] pub enum QrPaymentResult { /// An on-chain payment. Onchain {