Update java bindings with new generator and new upstream code
[ldk-java] / src / main / java / org / ldk / structs / HTLCUpdate.java
index 57f94ec2202165b714d91a7712ce81070e476f1c..5951ab2e22a28fd485b1bb8f978a4ac7cd5b92df 100644 (file)
@@ -5,6 +5,14 @@ import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
 
+
+/**
+ * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
+ * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
+ * preimage claim backward will lead to loss of funds.
+ * 
+ * [`chain::Watch`]: ../trait.Watch.html
+ */
 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class HTLCUpdate extends CommonBase {
        HTLCUpdate(Object _dummy, long ptr) { super(ptr); }
@@ -14,6 +22,9 @@ public class HTLCUpdate extends CommonBase {
                if (ptr != 0) { bindings.HTLCUpdate_free(ptr); }
        }
 
+       /**
+        * Creates a copy of the HTLCUpdate
+        */
        public HTLCUpdate clone() {
                long ret = bindings.HTLCUpdate_clone(this.ptr);
                HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret);
@@ -21,11 +32,17 @@ public class HTLCUpdate extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
+        */
        public byte[] write() {
                byte[] ret = bindings.HTLCUpdate_write(this.ptr);
                return ret;
        }
 
+       /**
+        * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
+        */
        public static Result_HTLCUpdateDecodeErrorZ constructor_read(byte[] ser) {
                long ret = bindings.HTLCUpdate_read(ser);
                Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);