Pin compiler_builtins to 0.1.109 when building std
[ldk-c-bindings] / lightning-c-bindings / demo.c
index 994adbf3cccc90889512ab7b9fb83add580e033a..c5993ce6775503b5581471930b86773c48f204fc 100644 (file)
@@ -4,16 +4,17 @@
 #include <stdio.h>
 #include <string.h>
 
-void print_log(const void *this_arg, const LDKRecord *record) {
-       LDKStr mod = Record_get_module_path(record);
-       LDKStr str = Record_get_args(record);
-       printf("%.*s:%d - %.*s\n", (int)mod.len, mod.chars, Record_get_line(record), (int)str.len, str.chars);
+void print_log(const void *this_arg, const LDKRecord record) {
+       LDKStr mod = Record_get_module_path(&record);
+       LDKStr str = Record_get_args(&record);
+       printf("%.*s:%d - %.*s\n", (int)mod.len, mod.chars, Record_get_line(&record), (int)str.len, str.chars);
        Str_free(str);
        Str_free(mod);
+       Record_free(record);
 }
 
 uint32_t get_fee(const void *this_arg, LDKConfirmationTarget target) {
-       if (target == LDKConfirmationTarget_Background) {
+       if (target == LDKConfirmationTarget_AnchorChannelFee || target == LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee) {
                return 253;
        } else {
                return 507;
@@ -25,14 +26,14 @@ void broadcast_txn(const void *this_arg, LDKCVec_TransactionZ txn) {
        CVec_TransactionZ_free(txn);
 }
 
-LDKChannelMonitorUpdateStatus add_channel_monitor(const void *this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
-       return ChannelMonitorUpdateStatus_completed();
+LDKCResult_ChannelMonitorUpdateStatusNoneZ add_channel_monitor(const void *this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
+       return CResult_ChannelMonitorUpdateStatusNoneZ_ok(ChannelMonitorUpdateStatus_completed());
 }
 LDKChannelMonitorUpdateStatus update_channel_monitor(const void *this_arg, LDKOutPoint funding_txo, const LDKChannelMonitorUpdate *monitor) {
        return ChannelMonitorUpdateStatus_completed();
 }
-LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ monitors_pending_monitor_events(const void *this_arg) {
-       LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ empty_htlc_vec = {
+LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ monitors_pending_monitor_events(const void *this_arg) {
+       LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ empty_htlc_vec = {
                .data = NULL,
                .datalen = 0,
        };