Skip to content

Commit 114d59d

Browse files
committed
Update C/C++ demo apps to new upstream API
1 parent b4a0ffe commit 114d59d

File tree

2 files changed

+68
-113
lines changed

2 files changed

+68
-113
lines changed

lightning-c-bindings/demo.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ void broadcast_txn(const void *this_arg, LDKCVec_TransactionZ txn) {
2626
CVec_TransactionZ_free(txn);
2727
}
2828

29-
LDKCResult_ChannelMonitorUpdateStatusNoneZ add_channel_monitor(const void *this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
29+
LDKCResult_ChannelMonitorUpdateStatusNoneZ add_channel_monitor(const void *this_arg, LDKChannelId chan_id, LDKChannelMonitor monitor) {
3030
return CResult_ChannelMonitorUpdateStatusNoneZ_ok(ChannelMonitorUpdateStatus_completed());
3131
}
32-
LDKChannelMonitorUpdateStatus update_channel_monitor(const void *this_arg, LDKOutPoint funding_txo, const LDKChannelMonitorUpdate *monitor) {
32+
LDKChannelMonitorUpdateStatus update_channel_monitor(const void *this_arg, LDKChannelId chan_id, const LDKChannelMonitorUpdate *monitor) {
3333
return ChannelMonitorUpdateStatus_completed();
3434
}
3535
LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ monitors_pending_monitor_events(const void *this_arg) {
@@ -46,14 +46,14 @@ LDKCResult_NoneReplayEventZ never_handle_event(const void *this_arg, const struc
4646
return CResult_NoneReplayEventZ_ok();
4747
}
4848

49-
LDKCResult_RouteLightningErrorZ do_find_route(const void *this_arg, LDKPublicKey payer, const LDKRouteParameters *route_params, LDKCVec_ChannelDetailsZ *first_hops, const LDKInFlightHtlcs inflight_htlcs) {
49+
LDKCResult_RouteStrZ do_find_route(const void *this_arg, LDKPublicKey payer, const LDKRouteParameters *route_params, LDKCVec_ChannelDetailsZ *first_hops, const LDKInFlightHtlcs inflight_htlcs) {
5050
LDKStr reason = { .chars = (const unsigned char*)"", .len = 0, .chars_is_owned = false };
51-
return CResult_RouteLightningErrorZ_err(LightningError_new(reason, ErrorAction_ignore_error()));
51+
return CResult_RouteStrZ_err(reason);
5252
}
5353

54-
LDKCResult_RouteLightningErrorZ do_find_route_with_id(const void *this_arg, LDKPublicKey payer, const LDKRouteParameters *route_params, LDKCVec_ChannelDetailsZ *first_hops, const LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_id) {
54+
LDKCResult_RouteStrZ do_find_route_with_id(const void *this_arg, LDKPublicKey payer, const LDKRouteParameters *route_params, LDKCVec_ChannelDetailsZ *first_hops, const LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_id) {
5555
LDKStr reason = { .chars = (const unsigned char*)"", .len = 0, .chars_is_owned = false };
56-
return CResult_RouteLightningErrorZ_err(LightningError_new(reason, ErrorAction_ignore_error()));
56+
return CResult_RouteStrZ_err(reason);
5757
}
5858

5959
int main() {
@@ -99,11 +99,10 @@ int main() {
9999
.this_arg = NULL,
100100
.find_path = NULL,
101101
.create_blinded_paths = NULL,
102-
.create_compact_blinded_paths = NULL,
103102
.free = NULL,
104103
};
105104

106-
LDKKeysManager keys = KeysManager_new(&node_seed, 0, 0);
105+
LDKKeysManager keys = KeysManager_new(&node_seed, 0, 0, true);
107106
LDKEntropySource entropy_source = KeysManager_as_EntropySource(&keys);
108107
LDKNodeSigner node_signer = KeysManager_as_NodeSigner(&keys);
109108
LDKSignerProvider signer_provider = KeysManager_as_SignerProvider(&keys);

0 commit comments

Comments
 (0)