Update auto-generated bindings with new upstream.
[ldk-java] / src / main / java / org / ldk / structs / CommitmentSigned.java
index 12f355221a9e874e1da41fff9d806647ce951251..b14e1ca416d28204e5dfd9ba858120bc07850ff0 100644 (file)
@@ -2,52 +2,63 @@ package org.ldk.structs;
 
 import org.ldk.impl.bindings;
 import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
 
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class CommitmentSigned extends CommonBase {
        CommitmentSigned(Object _dummy, long ptr) { super(ptr); }
        @Override @SuppressWarnings("deprecation")
        protected void finalize() throws Throwable {
                super.finalize();
-               bindings.CommitmentSigned_free(ptr);
+               if (ptr != 0) { bindings.CommitmentSigned_free(ptr); }
        }
 
-       public CommitmentSigned(CommitmentSigned orig) {
-               super(bindings.CommitmentSigned_clone(orig == null ? 0 : orig.ptr & ~1));
-               this.ptrs_to.add(orig);
+       public byte[] get_channel_id() {
+               byte[] ret = bindings.CommitmentSigned_get_channel_id(this.ptr);
+               return ret;
+       }
+
+       public void set_channel_id(byte[] val) {
+               bindings.CommitmentSigned_set_channel_id(this.ptr, val);
        }
 
-       public byte[] get_channel_id(CommitmentSigned this_ptr) {
-               byte[] ret = bindings.CommitmentSigned_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
+       public byte[] get_signature() {
+               byte[] ret = bindings.CommitmentSigned_get_signature(this.ptr);
                return ret;
        }
 
-       public void set_channel_id(CommitmentSigned this_ptr, byte[] val) {
-               bindings.CommitmentSigned_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
-               this.ptrs_to.add(this_ptr);
+       public void set_signature(byte[] val) {
+               bindings.CommitmentSigned_set_signature(this.ptr, val);
        }
 
-       public byte[] get_signature(CommitmentSigned this_ptr) {
-               byte[] ret = bindings.CommitmentSigned_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               return ret;
+       public void set_htlc_signatures(byte[][] val) {
+               bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val);
+       }
+
+       public static CommitmentSigned constructor_new(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) {
+               long ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg);
+               CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
        }
 
-       public void set_signature(CommitmentSigned this_ptr, byte[] val) {
-               bindings.CommitmentSigned_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
-               this.ptrs_to.add(this_ptr);
+       public CommitmentSigned clone() {
+               long ret = bindings.CommitmentSigned_clone(this.ptr);
+               CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
        }
 
-       // Skipped CommitmentSigned_set_htlc_signatures
-       // Skipped CommitmentSigned_new
-       public byte[] write(CommitmentSigned obj) {
-               byte[] ret = bindings.CommitmentSigned_write(obj == null ? 0 : obj.ptr & ~1);
-               this.ptrs_to.add(obj);
+       public byte[] write() {
+               byte[] ret = bindings.CommitmentSigned_write(this.ptr);
                return ret;
        }
 
-       public CommitmentSigned(byte[] ser) {
-               super(bindings.CommitmentSigned_read(ser));
+       public static Result_CommitmentSignedDecodeErrorZ constructor_read(byte[] ser) {
+               long ret = bindings.CommitmentSigned_read(ser);
+               Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
+               return ret_hu_conv;
        }
 
 }