Update auto-generated bindings with new upstream.
[ldk-java] / ts / structs / RoutingMessageHandler.ts
index 2ab676ca407715b6aec957cb26e98ee455fefc03..7d352482e77806bf86c189174105dca98c014380 100644 (file)
@@ -61,14 +61,14 @@ import * as bindings from '../bindings' // TODO: figure out location
 
                                                get_next_channel_announcements (starting_point: number, batch_amount: number): number[] {
                                                        ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] ret = arg.get_next_channel_announcements(starting_point, batch_amount);
-                               result: number[] = (number[])Arrays.stream(ret).map(arr_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(arr_conv_63.a == null ? 0 : arr_conv_63.a.ptr & ~1, arr_conv_63.b == null ? 0 : arr_conv_63.b.ptr & ~1, arr_conv_63.c == null ? 0 : arr_conv_63.c.ptr & ~1)).toArray();
+                               result: number[] = Arrays.stream(ret).map(arr_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(arr_conv_63.a == null ? 0 : arr_conv_63.a.ptr & ~1, arr_conv_63.b == null ? 0 : arr_conv_63.b.ptr & ~1, arr_conv_63.c == null ? 0 : arr_conv_63.c.ptr & ~1)).toArray(number[]::new);
                                /* TODO 2 ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>  */;
                                return result;
                                                },
 
                                                get_next_node_announcements (starting_point: Uint8Array, batch_amount: number): number[] {
                                                        NodeAnnouncement[] ret = arg.get_next_node_announcements(starting_point, batch_amount);
-                               result: number[] = (number[])Arrays.stream(ret).map(arr_conv_18 -> arr_conv_18 == null ? 0 : arr_conv_18.ptr & ~1).toArray();
+                               result: number[] = Arrays.stream(ret).map(arr_conv_18 -> arr_conv_18 == null ? 0 : arr_conv_18.ptr & ~1).toArray(number[]::new);
                                /* TODO 2 NodeAnnouncement  */;
                                return result;
                                                },
@@ -174,7 +174,12 @@ import * as bindings from '../bindings' // TODO: figure out location
                        number arr_conv_63_c = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(arr_conv_63);
                        const arr_conv_63_c_hu_conv: ChannelUpdate = new ChannelUpdate(null, arr_conv_63_c);
                        arr_conv_63_c_hu_conv.ptrs_to.add(this);;
-                       ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate> arr_conv_63_conv = new ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>(arr_conv_63_a_hu_conv, arr_conv_63_b_hu_conv, arr_conv_63_c_hu_conv);
+                       ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate> arr_conv_63_conv = new ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>(arr_conv_63_a_hu_conv, arr_conv_63_b_hu_conv, arr_conv_63_c_hu_conv, () -> {
+                               bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arr_conv_63);
+                       });
+                       arr_conv_63_a_hu_conv.ptrs_to.add(arr_conv_63_conv);
+                       arr_conv_63_b_hu_conv.ptrs_to.add(arr_conv_63_conv);
+                       arr_conv_63_c_hu_conv.ptrs_to.add(arr_conv_63_conv);
                        arr_conv_63_arr[l] = arr_conv_63_conv;
                }
                return arr_conv_63_arr;