Properly set CVec_u8Z to a byte[] which adds a ton more fn's
[ldk-java] / src / main / java / org / ldk / structs / CommitmentSigned.java
index 1a8b6aa7bb812bd912ef2882ddcc5fbb62be5222..12f355221a9e874e1da41fff9d806647ce951251 100644 (file)
@@ -7,7 +7,8 @@ public class CommitmentSigned extends CommonBase {
        CommitmentSigned(Object _dummy, long ptr) { super(ptr); }
        @Override @SuppressWarnings("deprecation")
        protected void finalize() throws Throwable {
-               bindings.CommitmentSigned_free(ptr); super.finalize();
+               super.finalize();
+               bindings.CommitmentSigned_free(ptr);
        }
 
        public CommitmentSigned(CommitmentSigned orig) {
@@ -39,7 +40,12 @@ public class CommitmentSigned extends CommonBase {
 
        // Skipped CommitmentSigned_set_htlc_signatures
        // Skipped CommitmentSigned_new
-       // Skipped CommitmentSigned_write
+       public byte[] write(CommitmentSigned obj) {
+               byte[] ret = bindings.CommitmentSigned_write(obj == null ? 0 : obj.ptr & ~1);
+               this.ptrs_to.add(obj);
+               return ret;
+       }
+
        public CommitmentSigned(byte[] ser) {
                super(bindings.CommitmentSigned_read(ser));
        }