Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / FundingCreated.java
index 6faf150f17f28c6633c42749eb65504a56969445..ce30b15f8459bdb5d01ab7c63d99866ad38ecad0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -30,7 +31,7 @@ public class FundingCreated extends CommonBase {
         * 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, val);
+               bindings.FundingCreated_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
        }
 
        /**
@@ -45,7 +46,7 @@ public class FundingCreated extends CommonBase {
         * The funding transaction ID
         */
        public void set_funding_txid(byte[] val) {
-               bindings.FundingCreated_set_funding_txid(this.ptr, val);
+               bindings.FundingCreated_set_funding_txid(this.ptr, InternalUtils.check_arr_len(val, 32));
        }
 
        /**
@@ -64,7 +65,7 @@ public class FundingCreated extends CommonBase {
        }
 
        /**
-        * The signature of the channel initiator (funder) on the funding transaction
+        * The signature of the channel initiator (funder) on the initial commitment transaction
         */
        public byte[] get_signature() {
                byte[] ret = bindings.FundingCreated_get_signature(this.ptr);
@@ -72,28 +73,35 @@ public class FundingCreated extends CommonBase {
        }
 
        /**
-        * The signature of the channel initiator (funder) on the funding transaction
+        * The signature of the channel initiator (funder) on the initial commitment transaction
         */
        public void set_signature(byte[] val) {
-               bindings.FundingCreated_set_signature(this.ptr, val);
+               bindings.FundingCreated_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
        }
 
        /**
         * Constructs a new FundingCreated given each field
         */
-       public static FundingCreated constructor_new(byte[] 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, funding_txid_arg, funding_output_index_arg, signature_arg);
-               FundingCreated ret_hu_conv = new FundingCreated(null, ret);
+       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));
+               if (ret >= 0 && ret <= 4096) { return null; }
+               FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
 
+       long clone_ptr() {
+               long ret = bindings.FundingCreated_clone_ptr(this.ptr);
+               return ret;
+       }
+
        /**
         * Creates a copy of the FundingCreated
         */
        public FundingCreated clone() {
                long ret = bindings.FundingCreated_clone(this.ptr);
-               FundingCreated ret_hu_conv = new FundingCreated(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -109,8 +117,9 @@ public class FundingCreated extends CommonBase {
        /**
         * Read a FundingCreated from a byte array, created by FundingCreated_write
         */
-       public static Result_FundingCreatedDecodeErrorZ constructor_read(byte[] ser) {
+       public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) {
                long ret = bindings.FundingCreated_read(ser);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }