Skip to content

Commit 00c361c

Browse files
committed
Update bindings to latest upstream code
1 parent 9d62a60 commit 00c361c

17 files changed

+2026
-2021
lines changed

lightning-c-bindings/include/lightning.h

Lines changed: 658 additions & 630 deletions
Large diffs are not rendered by default.

lightning-c-bindings/include/lightningpp.hpp

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

lightning-c-bindings/include/rust_types.h

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ struct nativeChannelConfigOpaque;
1616
typedef struct nativeChannelConfigOpaque LDKnativeChannelConfig;
1717
struct nativeUserConfigOpaque;
1818
typedef struct nativeUserConfigOpaque LDKnativeUserConfig;
19-
struct nativeChainWatchedUtilOpaque;
20-
typedef struct nativeChainWatchedUtilOpaque LDKnativeChainWatchedUtil;
21-
struct nativeBlockNotifierOpaque;
22-
typedef struct nativeBlockNotifierOpaque LDKnativeBlockNotifier;
23-
struct nativeChainWatchInterfaceUtilOpaque;
24-
typedef struct nativeChainWatchInterfaceUtilOpaque LDKnativeChainWatchInterfaceUtil;
19+
struct nativeChainMonitorOpaque;
20+
typedef struct nativeChainMonitorOpaque LDKnativeChainMonitor;
21+
struct nativeChannelMonitorUpdateOpaque;
22+
typedef struct nativeChannelMonitorUpdateOpaque LDKnativeChannelMonitorUpdate;
23+
struct nativeMonitorUpdateErrorOpaque;
24+
typedef struct nativeMonitorUpdateErrorOpaque LDKnativeMonitorUpdateError;
25+
struct nativeMonitorEventOpaque;
26+
typedef struct nativeMonitorEventOpaque LDKnativeMonitorEvent;
27+
struct nativeHTLCUpdateOpaque;
28+
typedef struct nativeHTLCUpdateOpaque LDKnativeHTLCUpdate;
29+
struct nativeChannelMonitorOpaque;
30+
typedef struct nativeChannelMonitorOpaque LDKnativeChannelMonitor;
2531
struct nativeOutPointOpaque;
2632
typedef struct nativeOutPointOpaque LDKnativeOutPoint;
2733
struct LDKChannelKeys;
@@ -38,16 +44,6 @@ struct nativePaymentSendFailureOpaque;
3844
typedef struct nativePaymentSendFailureOpaque LDKnativePaymentSendFailure;
3945
struct nativeChannelManagerReadArgsOpaque;
4046
typedef struct nativeChannelManagerReadArgsOpaque LDKnativeChannelManagerReadArgs;
41-
struct nativeChannelMonitorUpdateOpaque;
42-
typedef struct nativeChannelMonitorUpdateOpaque LDKnativeChannelMonitorUpdate;
43-
struct nativeMonitorUpdateErrorOpaque;
44-
typedef struct nativeMonitorUpdateErrorOpaque LDKnativeMonitorUpdateError;
45-
struct nativeMonitorEventOpaque;
46-
typedef struct nativeMonitorEventOpaque LDKnativeMonitorEvent;
47-
struct nativeHTLCUpdateOpaque;
48-
typedef struct nativeHTLCUpdateOpaque LDKnativeHTLCUpdate;
49-
struct nativeChannelMonitorOpaque;
50-
typedef struct nativeChannelMonitorOpaque LDKnativeChannelMonitor;
5147
struct nativeDecodeErrorOpaque;
5248
typedef struct nativeDecodeErrorOpaque LDKnativeDecodeError;
5349
struct nativeInitOpaque;

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

Lines changed: 74 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,91 @@ pub type CVec_EventZ = crate::c_types::CVecTempl<crate::util::events::Event>;
1414
pub static CVec_EventZ_free: extern "C" fn(CVec_EventZ) = crate::c_types::CVecTempl_free::<crate::util::events::Event>;
1515

1616
#[no_mangle]
17-
pub type C2Tuple_Txidu32Z = crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, u32>;
17+
pub type C2Tuple_usizeTransactionZ = crate::c_types::C2TupleTempl<usize, crate::c_types::Transaction>;
1818
#[no_mangle]
19-
pub static C2Tuple_Txidu32Z_free: extern "C" fn(C2Tuple_Txidu32Z) = crate::c_types::C2TupleTempl_free::<crate::c_types::ThirtyTwoBytes, u32>;
19+
pub static C2Tuple_usizeTransactionZ_free: extern "C" fn(C2Tuple_usizeTransactionZ) = crate::c_types::C2TupleTempl_free::<usize, crate::c_types::Transaction>;
2020
#[no_mangle]
21-
pub extern "C" fn C2Tuple_Txidu32Z_new(a: crate::c_types::ThirtyTwoBytes, b: u32) -> C2Tuple_Txidu32Z {
22-
C2Tuple_Txidu32Z {
21+
pub extern "C" fn C2Tuple_usizeTransactionZ_new(a: usize, b: crate::c_types::Transaction) -> C2Tuple_usizeTransactionZ {
22+
C2Tuple_usizeTransactionZ {
2323
a: Box::into_raw(Box::new(a)),
2424
b: Box::into_raw(Box::new(b)),
2525
}
2626
}
2727

2828
#[no_mangle]
29-
pub type C2Tuple_Scriptu64Z = crate::c_types::C2TupleTempl<crate::c_types::derived::CVec_u8Z, u64>;
29+
pub type CVec_C2Tuple_usizeTransactionZZ = crate::c_types::CVecTempl<crate::c_types::C2TupleTempl<usize, crate::c_types::Transaction>>;
3030
#[no_mangle]
31-
pub static C2Tuple_Scriptu64Z_free: extern "C" fn(C2Tuple_Scriptu64Z) = crate::c_types::C2TupleTempl_free::<crate::c_types::derived::CVec_u8Z, u64>;
31+
pub static CVec_C2Tuple_usizeTransactionZZ_free: extern "C" fn(CVec_C2Tuple_usizeTransactionZZ) = crate::c_types::CVecTempl_free::<crate::c_types::C2TupleTempl<usize, crate::c_types::Transaction>>;
32+
33+
#[no_mangle]
34+
pub type CResult_NoneChannelMonitorUpdateErrZ = crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::ChannelMonitorUpdateErr>;
35+
#[no_mangle]
36+
pub static CResult_NoneChannelMonitorUpdateErrZ_free: extern "C" fn(CResult_NoneChannelMonitorUpdateErrZ) = crate::c_types::CResultTempl_free::<u8, crate::chain::channelmonitor::ChannelMonitorUpdateErr>;
37+
#[no_mangle]
38+
pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_ok() -> CResult_NoneChannelMonitorUpdateErrZ {
39+
crate::c_types::CResultTempl::ok(0)
40+
}
41+
42+
#[no_mangle]
43+
pub static CResult_NoneChannelMonitorUpdateErrZ_err: extern "C" fn (crate::chain::channelmonitor::ChannelMonitorUpdateErr) -> CResult_NoneChannelMonitorUpdateErrZ =
44+
crate::c_types::CResultTempl::<u8, crate::chain::channelmonitor::ChannelMonitorUpdateErr>::err;
45+
3246
#[no_mangle]
33-
pub extern "C" fn C2Tuple_Scriptu64Z_new(a: crate::c_types::derived::CVec_u8Z, b: u64) -> C2Tuple_Scriptu64Z {
34-
C2Tuple_Scriptu64Z {
47+
pub type CVec_MonitorEventZ = crate::c_types::CVecTempl<crate::chain::channelmonitor::MonitorEvent>;
48+
#[no_mangle]
49+
pub static CVec_MonitorEventZ_free: extern "C" fn(CVec_MonitorEventZ) = crate::c_types::CVecTempl_free::<crate::chain::channelmonitor::MonitorEvent>;
50+
51+
#[no_mangle]
52+
pub type CResult_NoneMonitorUpdateErrorZ = crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::MonitorUpdateError>;
53+
#[no_mangle]
54+
pub static CResult_NoneMonitorUpdateErrorZ_free: extern "C" fn(CResult_NoneMonitorUpdateErrorZ) = crate::c_types::CResultTempl_free::<u8, crate::chain::channelmonitor::MonitorUpdateError>;
55+
#[no_mangle]
56+
pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_ok() -> CResult_NoneMonitorUpdateErrorZ {
57+
crate::c_types::CResultTempl::ok(0)
58+
}
59+
60+
#[no_mangle]
61+
pub static CResult_NoneMonitorUpdateErrorZ_err: extern "C" fn (crate::chain::channelmonitor::MonitorUpdateError) -> CResult_NoneMonitorUpdateErrorZ =
62+
crate::c_types::CResultTempl::<u8, crate::chain::channelmonitor::MonitorUpdateError>::err;
63+
64+
#[no_mangle]
65+
pub type C2Tuple_OutPointScriptZ = crate::c_types::C2TupleTempl<crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z>;
66+
#[no_mangle]
67+
pub static C2Tuple_OutPointScriptZ_free: extern "C" fn(C2Tuple_OutPointScriptZ) = crate::c_types::C2TupleTempl_free::<crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z>;
68+
#[no_mangle]
69+
pub extern "C" fn C2Tuple_OutPointScriptZ_new(a: crate::chain::transaction::OutPoint, b: crate::c_types::derived::CVec_u8Z) -> C2Tuple_OutPointScriptZ {
70+
C2Tuple_OutPointScriptZ {
3571
a: Box::into_raw(Box::new(a)),
3672
b: Box::into_raw(Box::new(b)),
3773
}
3874
}
3975

4076
#[no_mangle]
41-
pub type CResult_C2Tuple_Scriptu64ZChainErrorZ = crate::c_types::CResultTempl<crate::c_types::C2TupleTempl<crate::c_types::derived::CVec_u8Z, u64>, crate::chain::chaininterface::ChainError>;
77+
pub type CVec_TransactionZ = crate::c_types::CVecTempl<crate::c_types::Transaction>;
4278
#[no_mangle]
43-
pub static CResult_C2Tuple_Scriptu64ZChainErrorZ_free: extern "C" fn(CResult_C2Tuple_Scriptu64ZChainErrorZ) = crate::c_types::CResultTempl_free::<crate::c_types::C2TupleTempl<crate::c_types::derived::CVec_u8Z, u64>, crate::chain::chaininterface::ChainError>;
44-
#[no_mangle]
45-
pub static CResult_C2Tuple_Scriptu64ZChainErrorZ_ok: extern "C" fn (C2Tuple_Scriptu64Z) -> CResult_C2Tuple_Scriptu64ZChainErrorZ =
46-
crate::c_types::CResultTempl::<crate::c_types::C2TupleTempl<crate::c_types::derived::CVec_u8Z, u64>, crate::chain::chaininterface::ChainError>::ok;
79+
pub static CVec_TransactionZ_free: extern "C" fn(CVec_TransactionZ) = crate::c_types::CVecTempl_free::<crate::c_types::Transaction>;
4780

4881
#[no_mangle]
49-
pub static CResult_C2Tuple_Scriptu64ZChainErrorZ_err: extern "C" fn (crate::chain::chaininterface::ChainError) -> CResult_C2Tuple_Scriptu64ZChainErrorZ =
50-
crate::c_types::CResultTempl::<crate::c_types::C2TupleTempl<crate::c_types::derived::CVec_u8Z, u64>, crate::chain::chaininterface::ChainError>::err;
82+
pub type CVec_TxOutZ = crate::c_types::CVecTempl<crate::c_types::TxOut>;
83+
#[no_mangle]
84+
pub static CVec_TxOutZ_free: extern "C" fn(CVec_TxOutZ) = crate::c_types::CVecTempl_free::<crate::c_types::TxOut>;
5185

5286
#[no_mangle]
53-
pub type CVec_usizeZ = crate::c_types::CVecTempl<usize>;
87+
pub type C2Tuple_TxidCVec_TxOutZZ = crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::TxOut>>;
88+
#[no_mangle]
89+
pub static C2Tuple_TxidCVec_TxOutZZ_free: extern "C" fn(C2Tuple_TxidCVec_TxOutZZ) = crate::c_types::C2TupleTempl_free::<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::TxOut>>;
5490
#[no_mangle]
55-
pub static CVec_usizeZ_free: extern "C" fn(CVec_usizeZ) = crate::c_types::CVecTempl_free::<usize>;
91+
pub extern "C" fn C2Tuple_TxidCVec_TxOutZZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::c_types::derived::CVec_TxOutZ) -> C2Tuple_TxidCVec_TxOutZZ {
92+
C2Tuple_TxidCVec_TxOutZZ {
93+
a: Box::into_raw(Box::new(a)),
94+
b: Box::into_raw(Box::new(b)),
95+
}
96+
}
5697

5798
#[no_mangle]
58-
pub type CVec_TransactionZ = crate::c_types::CVecTempl<crate::c_types::derived::CVec_u8Z>;
99+
pub type CVec_C2Tuple_TxidCVec_TxOutZZZ = crate::c_types::CVecTempl<crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::TxOut>>>;
59100
#[no_mangle]
60-
pub static CVec_TransactionZ_free: extern "C" fn(CVec_TransactionZ) = crate::c_types::CVecTempl_free::<crate::c_types::derived::CVec_u8Z>;
101+
pub static CVec_C2Tuple_TxidCVec_TxOutZZZ_free: extern "C" fn(CVec_C2Tuple_TxidCVec_TxOutZZZ) = crate::c_types::CVecTempl_free::<crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::TxOut>>>;
61102

62103
#[no_mangle]
63104
pub type C2Tuple_u64u64Z = crate::c_types::C2TupleTempl<u64, u64>;
@@ -132,6 +173,18 @@ pub extern "C" fn CResult_CVec_SignatureZNoneZ_err() -> CResult_CVec_SignatureZN
132173
crate::c_types::CResultTempl::err(0)
133174
}
134175

176+
#[no_mangle]
177+
pub type CResult_TxOutAccessErrorZ = crate::c_types::CResultTempl<crate::c_types::TxOut, crate::chain::AccessError>;
178+
#[no_mangle]
179+
pub static CResult_TxOutAccessErrorZ_free: extern "C" fn(CResult_TxOutAccessErrorZ) = crate::c_types::CResultTempl_free::<crate::c_types::TxOut, crate::chain::AccessError>;
180+
#[no_mangle]
181+
pub static CResult_TxOutAccessErrorZ_ok: extern "C" fn (crate::c_types::TxOut) -> CResult_TxOutAccessErrorZ =
182+
crate::c_types::CResultTempl::<crate::c_types::TxOut, crate::chain::AccessError>::ok;
183+
184+
#[no_mangle]
185+
pub static CResult_TxOutAccessErrorZ_err: extern "C" fn (crate::chain::AccessError) -> CResult_TxOutAccessErrorZ =
186+
crate::c_types::CResultTempl::<crate::c_types::TxOut, crate::chain::AccessError>::err;
187+
135188
#[no_mangle]
136189
pub type CResult_NoneAPIErrorZ = crate::c_types::CResultTempl<u8, crate::util::errors::APIError>;
137190
#[no_mangle]
@@ -169,52 +222,9 @@ pub type CVec_NetAddressZ = crate::c_types::CVecTempl<crate::ln::msgs::NetAddres
169222
pub static CVec_NetAddressZ_free: extern "C" fn(CVec_NetAddressZ) = crate::c_types::CVecTempl_free::<crate::ln::msgs::NetAddress>;
170223

171224
#[no_mangle]
172-
pub type CVec_ChannelMonitorZ = crate::c_types::CVecTempl<crate::ln::channelmonitor::ChannelMonitor>;
173-
#[no_mangle]
174-
pub static CVec_ChannelMonitorZ_free: extern "C" fn(CVec_ChannelMonitorZ) = crate::c_types::CVecTempl_free::<crate::ln::channelmonitor::ChannelMonitor>;
175-
176-
#[no_mangle]
177-
pub type CResult_NoneChannelMonitorUpdateErrZ = crate::c_types::CResultTempl<u8, crate::ln::channelmonitor::ChannelMonitorUpdateErr>;
178-
#[no_mangle]
179-
pub static CResult_NoneChannelMonitorUpdateErrZ_free: extern "C" fn(CResult_NoneChannelMonitorUpdateErrZ) = crate::c_types::CResultTempl_free::<u8, crate::ln::channelmonitor::ChannelMonitorUpdateErr>;
180-
#[no_mangle]
181-
pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_ok() -> CResult_NoneChannelMonitorUpdateErrZ {
182-
crate::c_types::CResultTempl::ok(0)
183-
}
184-
185-
#[no_mangle]
186-
pub static CResult_NoneChannelMonitorUpdateErrZ_err: extern "C" fn (crate::ln::channelmonitor::ChannelMonitorUpdateErr) -> CResult_NoneChannelMonitorUpdateErrZ =
187-
crate::c_types::CResultTempl::<u8, crate::ln::channelmonitor::ChannelMonitorUpdateErr>::err;
188-
189-
#[no_mangle]
190-
pub type CVec_MonitorEventZ = crate::c_types::CVecTempl<crate::ln::channelmonitor::MonitorEvent>;
191-
#[no_mangle]
192-
pub static CVec_MonitorEventZ_free: extern "C" fn(CVec_MonitorEventZ) = crate::c_types::CVecTempl_free::<crate::ln::channelmonitor::MonitorEvent>;
193-
194-
#[no_mangle]
195-
pub type CResult_NoneMonitorUpdateErrorZ = crate::c_types::CResultTempl<u8, crate::ln::channelmonitor::MonitorUpdateError>;
225+
pub type CVec_ChannelMonitorZ = crate::c_types::CVecTempl<crate::chain::channelmonitor::ChannelMonitor>;
196226
#[no_mangle]
197-
pub static CResult_NoneMonitorUpdateErrorZ_free: extern "C" fn(CResult_NoneMonitorUpdateErrorZ) = crate::c_types::CResultTempl_free::<u8, crate::ln::channelmonitor::MonitorUpdateError>;
198-
#[no_mangle]
199-
pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_ok() -> CResult_NoneMonitorUpdateErrorZ {
200-
crate::c_types::CResultTempl::ok(0)
201-
}
202-
203-
#[no_mangle]
204-
pub static CResult_NoneMonitorUpdateErrorZ_err: extern "C" fn (crate::ln::channelmonitor::MonitorUpdateError) -> CResult_NoneMonitorUpdateErrorZ =
205-
crate::c_types::CResultTempl::<u8, crate::ln::channelmonitor::MonitorUpdateError>::err;
206-
207-
#[no_mangle]
208-
pub type C2Tuple_OutPointScriptZ = crate::c_types::C2TupleTempl<crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z>;
209-
#[no_mangle]
210-
pub static C2Tuple_OutPointScriptZ_free: extern "C" fn(C2Tuple_OutPointScriptZ) = crate::c_types::C2TupleTempl_free::<crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z>;
211-
#[no_mangle]
212-
pub extern "C" fn C2Tuple_OutPointScriptZ_new(a: crate::chain::transaction::OutPoint, b: crate::c_types::derived::CVec_u8Z) -> C2Tuple_OutPointScriptZ {
213-
C2Tuple_OutPointScriptZ {
214-
a: Box::into_raw(Box::new(a)),
215-
b: Box::into_raw(Box::new(b)),
216-
}
217-
}
227+
pub static CVec_ChannelMonitorZ_free: extern "C" fn(CVec_ChannelMonitorZ) = crate::c_types::CVecTempl_free::<crate::chain::channelmonitor::ChannelMonitor>;
218228

219229
#[no_mangle]
220230
pub type CVec_u64Z = crate::c_types::CVecTempl<u64>;

0 commit comments

Comments
 (0)