Expose signatures as byte[], check array lengths in C.
[ldk-java] / src / main / java / org / ldk / structs / ChannelUpdate.java
index 8f5d60e7480cca74dc78b85c7fb8ab2c1beca16e..6ad541d9ad485584d263c0cc266ed551fed3285c 100644 (file)
@@ -15,8 +15,17 @@ public class ChannelUpdate extends CommonBase {
                this.ptrs_to.add(orig);
        }
 
-       // Skipped ChannelUpdate_get_signature
-       // Skipped ChannelUpdate_set_signature
+       public byte[] get_signature(ChannelUpdate this_ptr) {
+               byte[] ret = bindings.ChannelUpdate_get_signature(this_ptr.ptr & ~1);
+               this.ptrs_to.add(this_ptr);
+               return ret;
+       }
+
+       public void set_signature(ChannelUpdate this_ptr, byte[] val) {
+               bindings.ChannelUpdate_set_signature(this_ptr.ptr & ~1, val);
+               this.ptrs_to.add(this_ptr);
+       }
+
        public UnsignedChannelUpdate get_contents(ChannelUpdate this_ptr) {
                UnsignedChannelUpdate ret = new UnsignedChannelUpdate(null, bindings.ChannelUpdate_get_contents(this_ptr.ptr & ~1));
                this.ptrs_to.add(this_ptr);
@@ -29,7 +38,11 @@ public class ChannelUpdate extends CommonBase {
                this.ptrs_to.add(val);
        }
 
-       // Skipped ChannelUpdate_new
+       public ChannelUpdate(byte[] signature_arg, UnsignedChannelUpdate contents_arg) {
+               super(bindings.ChannelUpdate_new(signature_arg, contents_arg.ptr & ~1));
+               this.ptrs_to.add(contents_arg);
+       }
+
        // Skipped ChannelUpdate_write
        // Skipped ChannelUpdate_read
 }