Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / UnsignedChannelUpdate.java
index 758565871ae17eb78e4497b4e2ba6bdc1cc5b356..5779143763efe6802073b833e2843bcec4f7fdf5 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 UnsignedChannelUpdate extends CommonBase {
         * The genesis hash of the blockchain where the channel is to be opened
         */
        public void set_chain_hash(byte[] val) {
-               bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, val);
+               bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
        }
 
        /**
@@ -152,12 +153,18 @@ public class UnsignedChannelUpdate extends CommonBase {
                bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val);
        }
 
+       long clone_ptr() {
+               long ret = bindings.UnsignedChannelUpdate_clone_ptr(this.ptr);
+               return ret;
+       }
+
        /**
         * Creates a copy of the UnsignedChannelUpdate
         */
        public UnsignedChannelUpdate clone() {
                long ret = bindings.UnsignedChannelUpdate_clone(this.ptr);
-               UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelUpdate(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -175,6 +182,7 @@ public class UnsignedChannelUpdate extends CommonBase {
         */
        public static Result_UnsignedChannelUpdateDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UnsignedChannelUpdate_read(ser);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }