Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / OutPoint.java
index a44b61e280f63b7b1049cc1247df7096a241c1e7..a181f35f2bed37b54ca9d0b051fa36646930472b 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;
 
 
 /**
@@ -33,7 +34,7 @@ public class OutPoint extends CommonBase {
         * The referenced transaction's txid.
         */
        public void set_txid(byte[] val) {
-               bindings.OutPoint_set_txid(this.ptr, val);
+               bindings.OutPoint_set_txid(this.ptr, InternalUtils.check_arr_len(val, 32));
        }
 
        /**
@@ -55,18 +56,25 @@ public class OutPoint extends CommonBase {
         * Constructs a new OutPoint given each field
         */
        public static OutPoint of(byte[] txid_arg, short index_arg) {
-               long ret = bindings.OutPoint_new(txid_arg, index_arg);
-               OutPoint ret_hu_conv = new OutPoint(null, ret);
+               long ret = bindings.OutPoint_new(InternalUtils.check_arr_len(txid_arg, 32), index_arg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
 
+       long clone_ptr() {
+               long ret = bindings.OutPoint_clone_ptr(this.ptr);
+               return ret;
+       }
+
        /**
         * Creates a copy of the OutPoint
         */
        public OutPoint clone() {
                long ret = bindings.OutPoint_clone(this.ptr);
-               OutPoint ret_hu_conv = new OutPoint(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -111,6 +119,7 @@ public class OutPoint extends CommonBase {
         */
        public static Result_OutPointDecodeErrorZ read(byte[] ser) {
                long ret = bindings.OutPoint_read(ser);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }