[C#] Update auto-generated bindings to LDK-C-Bindings 0.0.123.1
[ldk-java] / c_sharp / src / org / ldk / structs / FundingCreated.cs
index 37be957b49b153fc31da0a0d284aab3b2d81c2f0..0e15eaf89c10c5cac84353e6bc2a37d2fd94ff22 100644 (file)
@@ -22,35 +22,41 @@ public class FundingCreated : CommonBase {
        /**
         * A temporary channel ID, until the funding is established
         */
-       public byte[] get_temporary_channel_id() {
-               byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr);
+       public ChannelId get_temporary_channel_id() {
+               long ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+               return ret_hu_conv;
        }
 
        /**
         * A temporary channel ID, until the funding is established
         */
-       public void set_temporary_channel_id(byte[] val) {
-               bindings.FundingCreated_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+       public void set_temporary_channel_id(org.ldk.structs.ChannelId val) {
+               bindings.FundingCreated_set_temporary_channel_id(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
         * The funding transaction ID
         */
        public byte[] get_funding_txid() {
-               byte[] ret = bindings.FundingCreated_get_funding_txid(this.ptr);
+               long ret = bindings.FundingCreated_get_funding_txid(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        /**
         * The funding transaction ID
         */
        public void set_funding_txid(byte[] val) {
-               bindings.FundingCreated_set_funding_txid(this.ptr, InternalUtils.check_arr_len(val, 32));
+               bindings.FundingCreated_set_funding_txid(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
                GC.KeepAlive(this);
                GC.KeepAlive(val);
        }
@@ -77,16 +83,18 @@ public class FundingCreated : CommonBase {
         * The signature of the channel initiator (funder) on the initial commitment transaction
         */
        public byte[] get_signature() {
-               byte[] ret = bindings.FundingCreated_get_signature(this.ptr);
+               long ret = bindings.FundingCreated_get_signature(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        /**
         * The signature of the channel initiator (funder) on the initial commitment transaction
         */
        public void set_signature(byte[] val) {
-               bindings.FundingCreated_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+               bindings.FundingCreated_set_signature(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 64)));
                GC.KeepAlive(this);
                GC.KeepAlive(val);
        }
@@ -94,8 +102,8 @@ public class FundingCreated : CommonBase {
        /**
         * Constructs a new FundingCreated given each field
         */
-       public static FundingCreated of(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) {
-               long ret = bindings.FundingCreated_new(InternalUtils.check_arr_len(temporary_channel_id_arg, 32), InternalUtils.check_arr_len(funding_txid_arg, 32), funding_output_index_arg, InternalUtils.check_arr_len(signature_arg, 64));
+       public static FundingCreated of(org.ldk.structs.ChannelId temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) {
+               long ret = bindings.FundingCreated_new(temporary_channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_txid_arg, 32)), funding_output_index_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)));
                GC.KeepAlive(temporary_channel_id_arg);
                GC.KeepAlive(funding_txid_arg);
                GC.KeepAlive(funding_output_index_arg);
@@ -103,6 +111,7 @@ public class FundingCreated : CommonBase {
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingCreated(null, ret); }
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(temporary_channel_id_arg); };
                return ret_hu_conv;
        }
 
@@ -124,13 +133,25 @@ public class FundingCreated : CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Generates a non-cryptographic 64-bit hash of the FundingCreated.
+        */
+       public long hash() {
+               long ret = bindings.FundingCreated_hash(this.ptr);
+               GC.KeepAlive(this);
+               return ret;
+       }
+
+       public override int GetHashCode() {
+               return (int)this.hash();
+       }
        /**
         * Checks if two FundingCreateds contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
         * Two objects with NULL inner values will be considered "equal" here.
         */
        public bool eq(org.ldk.structs.FundingCreated b) {
-               bool ret = bindings.FundingCreated_eq(this.ptr, b == null ? 0 : b.ptr);
+               bool ret = bindings.FundingCreated_eq(this.ptr, b.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(b);
                if (this != null) { this.ptrs_to.AddLast(b); };
@@ -145,16 +166,18 @@ public class FundingCreated : CommonBase {
         * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
         */
        public byte[] write() {
-               byte[] ret = bindings.FundingCreated_write(this.ptr);
+               long ret = bindings.FundingCreated_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 FundingCreated from a byte array, created by FundingCreated_write
         */
        public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) {
-               long ret = bindings.FundingCreated_read(ser);
+               long ret = bindings.FundingCreated_read(InternalUtils.encodeUint8Array(ser));
                GC.KeepAlive(ser);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);