Skip to content

Commit 5502fcc

Browse files
committed
Update auto-generated bindings to LDK 0.0.118
1 parent 1ec49fa commit 5502fcc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4650
-2420
lines changed

lightning-c-bindings/include/ldk_rust_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ struct nativeDelayedPaymentOutputDescriptorOpaque;
2424
typedef struct nativeDelayedPaymentOutputDescriptorOpaque LDKnativeDelayedPaymentOutputDescriptor;
2525
struct nativeStaticPaymentOutputDescriptorOpaque;
2626
typedef struct nativeStaticPaymentOutputDescriptorOpaque LDKnativeStaticPaymentOutputDescriptor;
27+
struct nativeChannelDerivationParametersOpaque;
28+
typedef struct nativeChannelDerivationParametersOpaque LDKnativeChannelDerivationParameters;
29+
struct nativeHTLCDescriptorOpaque;
30+
typedef struct nativeHTLCDescriptorOpaque LDKnativeHTLCDescriptor;
2731
struct LDKChannelSigner;
2832
struct nativeInMemorySignerOpaque;
2933
typedef struct nativeInMemorySignerOpaque LDKnativeInMemorySigner;
@@ -121,12 +125,8 @@ struct nativeNodeAliasOpaque;
121125
typedef struct nativeNodeAliasOpaque LDKnativeNodeAlias;
122126
struct nativeNodeInfoOpaque;
123127
typedef struct nativeNodeInfoOpaque LDKnativeNodeInfo;
124-
struct nativeChannelDerivationParametersOpaque;
125-
typedef struct nativeChannelDerivationParametersOpaque LDKnativeChannelDerivationParameters;
126128
struct nativeAnchorDescriptorOpaque;
127129
typedef struct nativeAnchorDescriptorOpaque LDKnativeAnchorDescriptor;
128-
struct nativeHTLCDescriptorOpaque;
129-
typedef struct nativeHTLCDescriptorOpaque LDKnativeHTLCDescriptor;
130130
struct nativeInputOpaque;
131131
typedef struct nativeInputOpaque LDKnativeInput;
132132
struct nativeUtxoOpaque;

lightning-c-bindings/include/lightning.h

Lines changed: 1411 additions & 811 deletions
Large diffs are not rendered by default.

lightning-c-bindings/include/lightningpp.hpp

Lines changed: 279 additions & 144 deletions
Large diffs are not rendered by default.

lightning-c-bindings/src/c_types/derived.rs

Lines changed: 671 additions & 283 deletions
Large diffs are not rendered by default.

lightning-c-bindings/src/lightning/blinded_path/mod.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl Clone for BlindedPath {
166166
#[allow(unused)]
167167
/// Used only if an object of this type is returned as a trait impl by a method
168168
pub(crate) extern "C" fn BlindedPath_clone_void(this_ptr: *const c_void) -> *mut c_void {
169-
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBlindedPath)).clone() })) as *mut c_void
169+
Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBlindedPath)).clone() })) as *mut c_void
170170
}
171171
#[no_mangle]
172172
/// Creates a copy of the BlindedPath
@@ -293,7 +293,7 @@ impl Clone for BlindedHop {
293293
#[allow(unused)]
294294
/// Used only if an object of this type is returned as a trait impl by a method
295295
pub(crate) extern "C" fn BlindedHop_clone_void(this_ptr: *const c_void) -> *mut c_void {
296-
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBlindedHop)).clone() })) as *mut c_void
296+
Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBlindedHop)).clone() })) as *mut c_void
297297
}
298298
#[no_mangle]
299299
/// Creates a copy of the BlindedHop
@@ -319,10 +319,19 @@ pub extern "C" fn BlindedHop_eq(a: &BlindedHop, b: &BlindedHop) -> bool {
319319
if a.inner.is_null() || b.inner.is_null() { return false; }
320320
if a.get_native_ref() == b.get_native_ref() { true } else { false }
321321
}
322+
/// Create a one-hop blinded path for a message.
323+
#[must_use]
324+
#[no_mangle]
325+
pub extern "C" fn BlindedPath_one_hop_for_message(mut recipient_node_id: crate::c_types::PublicKey, entropy_source: &crate::lightning::sign::EntropySource) -> crate::c_types::derived::CResult_BlindedPathNoneZ {
326+
let mut ret = lightning::blinded_path::BlindedPath::one_hop_for_message(recipient_node_id.into_rust(), entropy_source, secp256k1::global::SECP256K1);
327+
let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::blinded_path::BlindedPath { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
328+
local_ret
329+
}
330+
322331
/// Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
323332
/// pubkey in `node_pks` will be the destination node.
324333
///
325-
/// Errors if less than two hops are provided or if `node_pk`(s) are invalid.
334+
/// Errors if no hops are provided or if `node_pk`(s) are invalid.
326335
#[must_use]
327336
#[no_mangle]
328337
pub extern "C" fn BlindedPath_new_for_message(mut node_pks: crate::c_types::derived::CVec_PublicKeyZ, entropy_source: &crate::lightning::sign::EntropySource) -> crate::c_types::derived::CResult_BlindedPathNoneZ {
@@ -346,7 +355,7 @@ pub extern "C" fn BlindedPath_one_hop_for_payment(mut payee_node_id: crate::c_ty
346355
pub extern "C" fn BlindedPath_write(obj: &crate::lightning::blinded_path::BlindedPath) -> crate::c_types::derived::CVec_u8Z {
347356
crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
348357
}
349-
#[no_mangle]
358+
#[allow(unused)]
350359
pub(crate) extern "C" fn BlindedPath_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
351360
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedPath) })
352361
}
@@ -362,7 +371,7 @@ pub extern "C" fn BlindedPath_read(ser: crate::c_types::u8slice) -> crate::c_typ
362371
pub extern "C" fn BlindedHop_write(obj: &crate::lightning::blinded_path::BlindedHop) -> crate::c_types::derived::CVec_u8Z {
363372
crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
364373
}
365-
#[no_mangle]
374+
#[allow(unused)]
366375
pub(crate) extern "C" fn BlindedHop_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
367376
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHop) })
368377
}

lightning-c-bindings/src/lightning/blinded_path/payment.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl Clone for ForwardNode {
127127
#[allow(unused)]
128128
/// Used only if an object of this type is returned as a trait impl by a method
129129
pub(crate) extern "C" fn ForwardNode_clone_void(this_ptr: *const c_void) -> *mut c_void {
130-
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeForwardNode)).clone() })) as *mut c_void
130+
Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeForwardNode)).clone() })) as *mut c_void
131131
}
132132
#[no_mangle]
133133
/// Creates a copy of the ForwardNode
@@ -258,7 +258,7 @@ impl Clone for ForwardTlvs {
258258
#[allow(unused)]
259259
/// Used only if an object of this type is returned as a trait impl by a method
260260
pub(crate) extern "C" fn ForwardTlvs_clone_void(this_ptr: *const c_void) -> *mut c_void {
261-
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeForwardTlvs)).clone() })) as *mut c_void
261+
Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeForwardTlvs)).clone() })) as *mut c_void
262262
}
263263
#[no_mangle]
264264
/// Creates a copy of the ForwardTlvs
@@ -360,7 +360,7 @@ impl Clone for ReceiveTlvs {
360360
#[allow(unused)]
361361
/// Used only if an object of this type is returned as a trait impl by a method
362362
pub(crate) extern "C" fn ReceiveTlvs_clone_void(this_ptr: *const c_void) -> *mut c_void {
363-
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReceiveTlvs)).clone() })) as *mut c_void
363+
Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeReceiveTlvs)).clone() })) as *mut c_void
364364
}
365365
#[no_mangle]
366366
/// Creates a copy of the ReceiveTlvs
@@ -477,7 +477,7 @@ impl Clone for PaymentRelay {
477477
#[allow(unused)]
478478
/// Used only if an object of this type is returned as a trait impl by a method
479479
pub(crate) extern "C" fn PaymentRelay_clone_void(this_ptr: *const c_void) -> *mut c_void {
480-
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePaymentRelay)).clone() })) as *mut c_void
480+
Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativePaymentRelay)).clone() })) as *mut c_void
481481
}
482482
#[no_mangle]
483483
/// Creates a copy of the PaymentRelay
@@ -537,15 +537,13 @@ impl PaymentConstraints {
537537
ret
538538
}
539539
}
540-
/// The maximum total CLTV delta that is acceptable when relaying a payment over this
541-
/// [`BlindedHop`].
540+
/// The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
542541
#[no_mangle]
543542
pub extern "C" fn PaymentConstraints_get_max_cltv_expiry(this_ptr: &PaymentConstraints) -> u32 {
544543
let mut inner_val = &mut this_ptr.get_native_mut_ref().max_cltv_expiry;
545544
*inner_val
546545
}
547-
/// The maximum total CLTV delta that is acceptable when relaying a payment over this
548-
/// [`BlindedHop`].
546+
/// The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
549547
#[no_mangle]
550548
pub extern "C" fn PaymentConstraints_set_max_cltv_expiry(this_ptr: &mut PaymentConstraints, mut val: u32) {
551549
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.max_cltv_expiry = val;
@@ -584,7 +582,7 @@ impl Clone for PaymentConstraints {
584582
#[allow(unused)]
585583
/// Used only if an object of this type is returned as a trait impl by a method
586584
pub(crate) extern "C" fn PaymentConstraints_clone_void(this_ptr: *const c_void) -> *mut c_void {
587-
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePaymentConstraints)).clone() })) as *mut c_void
585+
Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativePaymentConstraints)).clone() })) as *mut c_void
588586
}
589587
#[no_mangle]
590588
/// Creates a copy of the PaymentConstraints
@@ -596,7 +594,7 @@ pub extern "C" fn PaymentConstraints_clone(orig: &PaymentConstraints) -> Payment
596594
pub extern "C" fn ForwardTlvs_write(obj: &crate::lightning::blinded_path::payment::ForwardTlvs) -> crate::c_types::derived::CVec_u8Z {
597595
crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
598596
}
599-
#[no_mangle]
597+
#[allow(unused)]
600598
pub(crate) extern "C" fn ForwardTlvs_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
601599
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeForwardTlvs) })
602600
}
@@ -605,7 +603,7 @@ pub(crate) extern "C" fn ForwardTlvs_write_void(obj: *const c_void) -> crate::c_
605603
pub extern "C" fn ReceiveTlvs_write(obj: &crate::lightning::blinded_path::payment::ReceiveTlvs) -> crate::c_types::derived::CVec_u8Z {
606604
crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
607605
}
608-
#[no_mangle]
606+
#[allow(unused)]
609607
pub(crate) extern "C" fn ReceiveTlvs_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
610608
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeReceiveTlvs) })
611609
}
@@ -621,7 +619,7 @@ pub extern "C" fn ReceiveTlvs_read(ser: crate::c_types::u8slice) -> crate::c_typ
621619
pub extern "C" fn PaymentRelay_write(obj: &crate::lightning::blinded_path::payment::PaymentRelay) -> crate::c_types::derived::CVec_u8Z {
622620
crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
623621
}
624-
#[no_mangle]
622+
#[allow(unused)]
625623
pub(crate) extern "C" fn PaymentRelay_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
626624
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativePaymentRelay) })
627625
}
@@ -637,7 +635,7 @@ pub extern "C" fn PaymentRelay_read(ser: crate::c_types::u8slice) -> crate::c_ty
637635
pub extern "C" fn PaymentConstraints_write(obj: &crate::lightning::blinded_path::payment::PaymentConstraints) -> crate::c_types::derived::CVec_u8Z {
638636
crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
639637
}
640-
#[no_mangle]
638+
#[allow(unused)]
641639
pub(crate) extern "C" fn PaymentConstraints_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
642640
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativePaymentConstraints) })
643641
}

0 commit comments

Comments
 (0)