Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / OpenChannel.java
index ce1dd35be1603be7b60e4974819390a9367f3875..46dee55caec630e0e022638cf5fbe8fb0d4994a0 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 OpenChannel extends CommonBase {
         * The genesis hash of the blockchain where the channel is to be opened
         */
        public void set_chain_hash(byte[] val) {
-               bindings.OpenChannel_set_chain_hash(this.ptr, val);
+               bindings.OpenChannel_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
        }
 
        /**
@@ -45,7 +46,7 @@ public class OpenChannel extends CommonBase {
         * A temporary channel ID, until the funding outpoint is announced
         */
        public void set_temporary_channel_id(byte[] val) {
-               bindings.OpenChannel_set_temporary_channel_id(this.ptr, val);
+               bindings.OpenChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
        }
 
        /**
@@ -195,7 +196,7 @@ public class OpenChannel extends CommonBase {
         * The sender's key controlling the funding transaction
         */
        public void set_funding_pubkey(byte[] val) {
-               bindings.OpenChannel_set_funding_pubkey(this.ptr, val);
+               bindings.OpenChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
        }
 
        /**
@@ -210,7 +211,7 @@ public class OpenChannel extends CommonBase {
         * Used to derive a revocation key for transactions broadcast by counterparty
         */
        public void set_revocation_basepoint(byte[] val) {
-               bindings.OpenChannel_set_revocation_basepoint(this.ptr, val);
+               bindings.OpenChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
        }
 
        /**
@@ -225,7 +226,7 @@ public class OpenChannel extends CommonBase {
         * A payment key to sender for transactions broadcast by counterparty
         */
        public void set_payment_point(byte[] val) {
-               bindings.OpenChannel_set_payment_point(this.ptr, val);
+               bindings.OpenChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
        }
 
        /**
@@ -240,7 +241,7 @@ public class OpenChannel extends CommonBase {
         * Used to derive a payment key to sender for transactions broadcast by sender
         */
        public void set_delayed_payment_basepoint(byte[] val) {
-               bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, val);
+               bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
        }
 
        /**
@@ -255,7 +256,7 @@ public class OpenChannel extends CommonBase {
         * Used to derive an HTLC payment key to sender
         */
        public void set_htlc_basepoint(byte[] val) {
-               bindings.OpenChannel_set_htlc_basepoint(this.ptr, val);
+               bindings.OpenChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
        }
 
        /**
@@ -270,7 +271,7 @@ public class OpenChannel extends CommonBase {
         * The first to-be-broadcast-by-sender transaction's per commitment point
         */
        public void set_first_per_commitment_point(byte[] val) {
-               bindings.OpenChannel_set_first_per_commitment_point(this.ptr, val);
+               bindings.OpenChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
        }
 
        /**
@@ -288,12 +289,18 @@ public class OpenChannel extends CommonBase {
                bindings.OpenChannel_set_channel_flags(this.ptr, val);
        }
 
+       long clone_ptr() {
+               long ret = bindings.OpenChannel_clone_ptr(this.ptr);
+               return ret;
+       }
+
        /**
         * Creates a copy of the OpenChannel
         */
        public OpenChannel clone() {
                long ret = bindings.OpenChannel_clone(this.ptr);
-               OpenChannel ret_hu_conv = new OpenChannel(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               OpenChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OpenChannel(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -309,8 +316,9 @@ public class OpenChannel extends CommonBase {
        /**
         * Read a OpenChannel from a byte array, created by OpenChannel_write
         */
-       public static Result_OpenChannelDecodeErrorZ constructor_read(byte[] ser) {
+       public static Result_OpenChannelDecodeErrorZ read(byte[] ser) {
                long ret = bindings.OpenChannel_read(ser);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }