Skip to content

Commit 520e5aa

Browse files
committed
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.
1 parent 40a3aeb commit 520e5aa

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

bindings/ldk_node.udl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ dictionary RouteHintHop {
715715
RoutingFees fees;
716716
};
717717

718+
[Traits=(Debug, Display, Eq)]
718719
interface Bolt11Invoice {
719720
[Throws=NodeError, Name=from_str]
720721
constructor([ByRef] string invoice_str);

src/ffi/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ impl From<lightning::routing::router::RouteHintHop> for RouteHintHop {
926926
/// Represents a syntactically and semantically correct lightning BOLT11 invoice.
927927
#[derive(Debug, Clone, PartialEq, Eq)]
928928
pub struct Bolt11Invoice {
929-
pub inner: LdkBolt11Invoice,
929+
pub(crate) inner: LdkBolt11Invoice,
930930
}
931931

932932
impl Bolt11Invoice {

src/payment/unified_qr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ impl UnifiedQrPayment {
188188
/// [BIP 21]: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki
189189
/// [`PaymentId`]: lightning::ln::channelmanager::PaymentId
190190
/// [`Txid`]: bitcoin::hash_types::Txid
191+
#[derive(Debug)]
191192
pub enum QrPaymentResult {
192193
/// An on-chain payment.
193194
Onchain {

0 commit comments

Comments
 (0)