Expose signatures as byte[], check array lengths in C.
[ldk-java] / src / main / java / org / ldk / structs / ClosingSigned.java
index 4b2e845412cead7bff490f731d68ad1bd4fb3aaf..573ba289fc9e7fc045f7a980ab447cf6d9d4e82c 100644 (file)
@@ -37,9 +37,21 @@ public class ClosingSigned extends CommonBase {
                this.ptrs_to.add(this_ptr);
        }
 
-       // Skipped ClosingSigned_get_signature
-       // Skipped ClosingSigned_set_signature
-       // Skipped ClosingSigned_new
+       public byte[] get_signature(ClosingSigned this_ptr) {
+               byte[] ret = bindings.ClosingSigned_get_signature(this_ptr.ptr & ~1);
+               this.ptrs_to.add(this_ptr);
+               return ret;
+       }
+
+       public void set_signature(ClosingSigned this_ptr, byte[] val) {
+               bindings.ClosingSigned_set_signature(this_ptr.ptr & ~1, val);
+               this.ptrs_to.add(this_ptr);
+       }
+
+       public ClosingSigned(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg) {
+               super(bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg));
+       }
+
        // Skipped ClosingSigned_write
        // Skipped ClosingSigned_read
 }