[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / NodeAnnouncementInfo.cs
index 0d1053b4fdb935090e475d425e5c3fdfb74064e7..e1a6e0227b2675915bd1c20c163cc66cee1e7767 100644 (file)
@@ -61,16 +61,18 @@ public class NodeAnnouncementInfo : CommonBase {
         * Color assigned to the node
         */
        public byte[] get_rgb() {
-               byte[] ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr);
+               long ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        /**
         * Color assigned to the node
         */
        public void set_rgb(byte[] val) {
-               bindings.NodeAnnouncementInfo_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3));
+               bindings.NodeAnnouncementInfo_set_rgb(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 3)));
                GC.KeepAlive(this);
                GC.KeepAlive(val);
        }
@@ -135,9 +137,11 @@ public class NodeAnnouncementInfo : CommonBase {
 
        /**
         * Constructs a new NodeAnnouncementInfo given each field
+        * 
+        * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public static NodeAnnouncementInfo of(org.ldk.structs.NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, org.ldk.structs.NodeAnnouncement announcement_message_arg) {
-               long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), alias_arg == null ? 0 : alias_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr);
+               long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr, last_update_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(rgb_arg, 3)), alias_arg == null ? 0 : alias_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr);
                GC.KeepAlive(features_arg);
                GC.KeepAlive(last_update_arg);
                GC.KeepAlive(rgb_arg);
@@ -190,34 +194,38 @@ public class NodeAnnouncementInfo : CommonBase {
        /**
         * Internet-level addresses via which one can connect to the node
         */
-       public NetAddress[] addresses() {
-               long[] ret = bindings.NodeAnnouncementInfo_addresses(this.ptr);
+       public SocketAddress[] addresses() {
+               long ret = bindings.NodeAnnouncementInfo_addresses(this.ptr);
                GC.KeepAlive(this);
-               int ret_conv_12_len = ret.Length;
-               NetAddress[] ret_conv_12_arr = new NetAddress[ret_conv_12_len];
-               for (int m = 0; m < ret_conv_12_len; m++) {
-                       long ret_conv_12 = ret[m];
-                       org.ldk.structs.NetAddress ret_conv_12_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret_conv_12);
-                       if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.AddLast(this); };
-                       ret_conv_12_arr[m] = ret_conv_12_hu_conv;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               int ret_conv_15_len = InternalUtils.getArrayLength(ret);
+               SocketAddress[] ret_conv_15_arr = new SocketAddress[ret_conv_15_len];
+               for (int p = 0; p < ret_conv_15_len; p++) {
+                       long ret_conv_15 = InternalUtils.getU64ArrayElem(ret, p);
+                       org.ldk.structs.SocketAddress ret_conv_15_hu_conv = org.ldk.structs.SocketAddress.constr_from_ptr(ret_conv_15);
+                       if (ret_conv_15_hu_conv != null) { ret_conv_15_hu_conv.ptrs_to.AddLast(this); };
+                       ret_conv_15_arr[p] = ret_conv_15_hu_conv;
                }
-               return ret_conv_12_arr;
+               bindings.free_buffer(ret);
+               return ret_conv_15_arr;
        }
 
        /**
         * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
         */
        public byte[] write() {
-               byte[] ret = bindings.NodeAnnouncementInfo_write(this.ptr);
+               long ret = bindings.NodeAnnouncementInfo_write(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        /**
         * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
         */
        public static Result_NodeAnnouncementInfoDecodeErrorZ read(byte[] ser) {
-               long ret = bindings.NodeAnnouncementInfo_read(ser);
+               long ret = bindings.NodeAnnouncementInfo_read(InternalUtils.encodeUint8Array(ser));
                GC.KeepAlive(ser);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);