Skip to content

Commit 9c6d1f1

Browse files
authored
Merge pull request #87 from TheBlueMatt/main
LDK 0.0.110
2 parents 1c42b23 + f10bdbe commit 9c6d1f1

File tree

21 files changed

+1816
-300
lines changed

21 files changed

+1816
-300
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: |
3838
git clone https://github.com/rust-bitcoin/rust-lightning
3939
cd rust-lightning
40-
git checkout 0.0.109-bindings
40+
git checkout 0.0.110-bindings
4141
- name: Rebuild bindings without std, and check the sample app builds + links
4242
run: ./genbindings.sh ./rust-lightning false
4343
- name: Rebuild bindings, and check the sample app builds + links
@@ -88,7 +88,7 @@ jobs:
8888
run: |
8989
git clone https://github.com/rust-bitcoin/rust-lightning
9090
cd rust-lightning
91-
git checkout 0.0.109-bindings
91+
git checkout 0.0.110-bindings
9292
- name: Rebuild bindings using Apple clang, and check the sample app builds + links
9393
run: ./genbindings.sh ./rust-lightning true
9494
- name: Rebuild bindings using upstream clang, and check the sample app builds + links

lightning-c-bindings/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ std = ["bitcoin/std", "lightning/std", "lightning-invoice/std"]
2222
bitcoin = { version = "0.28", default-features = false }
2323
secp256k1 = { version = "0.22", features = ["global-context", "recovery"] }
2424
# Note that the following line is matched by genbindings to update the path
25-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.109-bindings", default-features = false }
26-
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.109-bindings", default-features = false }
27-
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.109-bindings", default-features = false }
28-
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.109-bindings", default-features = false }
29-
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.109-bindings", default-features = false }
25+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false }
26+
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false }
27+
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false }
28+
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false }
29+
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false }
3030

3131
core2 = { version = "0.3.0", optional = true, default-features = false }
3232

lightning-c-bindings/demo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ LDKCResult_NoneChannelMonitorUpdateErrZ add_channel_monitor(const void *this_arg
3131
LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_monitor(const void *this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate monitor) {
3232
return CResult_NoneChannelMonitorUpdateErrZ_ok();
3333
}
34-
LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ monitors_pending_monitor_events(const void *this_arg) {
35-
LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ empty_htlc_vec = {
34+
LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ monitors_pending_monitor_events(const void *this_arg) {
35+
LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ empty_htlc_vec = {
3636
.data = NULL,
3737
.datalen = 0,
3838
};

lightning-c-bindings/demo.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_monitor(const void *this_
167167
LDKBroadcasterInterface broadcaster = {
168168
.broadcast_transaction = broadcast_tx,
169169
};
170-
LDK::CResult_NoneNoneZ res = ChannelMonitor_update_monitor(&mon.second, &update, &broadcaster, &fee_est, arg->logger);
170+
LDK::CResult_NoneNoneZ res = ChannelMonitor_update_monitor(&mon.second, &update, &broadcaster, fee_est, arg->logger);
171171
assert(res->result_ok);
172172
}
173173
}
@@ -176,12 +176,12 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_monitor(const void *this_
176176
mons_updated += 1;
177177
return CResult_NoneChannelMonitorUpdateErrZ_ok();
178178
}
179-
LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ monitors_pending_monitor_events(const void *this_arg) {
179+
LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ monitors_pending_monitor_events(const void *this_arg) {
180180
NodeMonitors* arg = (NodeMonitors*) this_arg;
181181
std::unique_lock<std::mutex> l(arg->mut);
182182

183183
if (arg->mons.size() == 0) {
184-
return LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ {
184+
return LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
185185
.data = NULL,
186186
.datalen = 0,
187187
};
@@ -192,12 +192,13 @@ LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ monitors_pending_monitor_events(con
192192
LDK::CVec_MonitorEventZ events = ChannelMonitor_get_and_clear_pending_monitor_events(&arg->mons[0].second);
193193
LDK::C2Tuple_OutPointScriptZ funding_info = ChannelMonitor_get_funding_txo(&arg->mons[0].second);
194194
LDK::OutPoint outpoint = std::move(funding_info->a);
195-
LDK::C2Tuple_OutPointCVec_MonitorEventZZ pair = C2Tuple_OutPointCVec_MonitorEventZZ_new(std::move(outpoint), std::move(events));
196-
auto vec = LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ {
197-
.data = (LDKC2Tuple_OutPointCVec_MonitorEventZZ*)malloc(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ)),
195+
LDKPublicKey counterparty_node_id = ChannelMonitor_get_counterparty_node_id(&arg->mons[0].second);
196+
LDK::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ tuple = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(std::move(outpoint), std::move(events), std::move(counterparty_node_id));
197+
auto vec = LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
198+
.data = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)malloc(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ)),
198199
.datalen = 1,
199200
};
200-
vec.data[0] = std::move(pair);
201+
vec.data[0] = std::move(tuple);
201202
return vec;
202203
}
203204
}
@@ -711,7 +712,8 @@ int main() {
711712
LDK::RouteParameters route_params = RouteParameters_new(PaymentParameters_new(
712713
ChannelManager_get_our_node_id(&cm2), LDKInvoiceFeatures {
713714
.inner = NULL, .is_owned = false
714-
}, Invoice_route_hints(invoice->contents.result), COption_u64Z_none(), 0xffffffff, 1),
715+
}, Invoice_route_hints(invoice->contents.result), COption_u64Z_none(), 0xffffffff,
716+
1, 2, LDKCVec_u64Z { .data = NULL, .datalen = 0 }),
715717
5000, Invoice_min_final_cltv_expiry(invoice->contents.result));
716718
random_bytes = keys_source1->get_secure_random_bytes(keys_source1->this_arg);
717719

lightning-c-bindings/include/ldk_rust_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ struct nativeUserConfigOpaque;
137137
typedef struct nativeUserConfigOpaque LDKnativeUserConfig;
138138
struct nativeBigSizeOpaque;
139139
typedef struct nativeBigSizeOpaque LDKnativeBigSize;
140+
struct nativeHostnameOpaque;
141+
typedef struct nativeHostnameOpaque LDKnativeHostname;
140142
struct nativeOutPointOpaque;
141143
typedef struct nativeOutPointOpaque LDKnativeOutPoint;
142144
struct nativeInvoicePayerOpaque;

0 commit comments

Comments
 (0)