[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / NodeAlias.cs
index b0cb8e6b8eec0c59646dc7b56799745f3c1e3910..8121cf1423f4090a4ae1e23e3a0b95e97203dfc6 100644 (file)
@@ -19,13 +19,15 @@ public class NodeAlias : CommonBase {
        }
 
        public byte[] get_a() {
-               byte[] ret = bindings.NodeAlias_get_a(this.ptr);
+               long ret = bindings.NodeAlias_get_a(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        public void set_a(byte[] val) {
-               bindings.NodeAlias_set_a(this.ptr, InternalUtils.check_arr_len(val, 32));
+               bindings.NodeAlias_set_a(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
                GC.KeepAlive(this);
                GC.KeepAlive(val);
        }
@@ -34,7 +36,7 @@ public class NodeAlias : CommonBase {
         * Constructs a new NodeAlias given each field
         */
        public static NodeAlias of(byte[] a_arg) {
-               long ret = bindings.NodeAlias_new(InternalUtils.check_arr_len(a_arg, 32));
+               long ret = bindings.NodeAlias_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a_arg, 32)));
                GC.KeepAlive(a_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); }
@@ -60,6 +62,18 @@ public class NodeAlias : CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Generates a non-cryptographic 64-bit hash of the NodeAlias.
+        */
+       public long hash() {
+               long ret = bindings.NodeAlias_hash(this.ptr);
+               GC.KeepAlive(this);
+               return ret;
+       }
+
+       public override int GetHashCode() {
+               return (int)this.hash();
+       }
        /**
         * Checks if two NodeAliass contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -81,16 +95,18 @@ public class NodeAlias : CommonBase {
         * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
         */
        public byte[] write() {
-               byte[] ret = bindings.NodeAlias_write(this.ptr);
+               long ret = bindings.NodeAlias_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 NodeAlias from a byte array, created by NodeAlias_write
         */
        public static Result_NodeAliasDecodeErrorZ read(byte[] ser) {
-               long ret = bindings.NodeAlias_read(ser);
+               long ret = bindings.NodeAlias_read(InternalUtils.encodeUint8Array(ser));
                GC.KeepAlive(ser);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_NodeAliasDecodeErrorZ ret_hu_conv = Result_NodeAliasDecodeErrorZ.constr_from_ptr(ret);