[Java] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / src / main / java / org / ldk / structs / Fallback.java
index 17661f8b2064f848d1009c767b89d8027c1cbb07..190bbe904b5bb251b2f7ac2718a9251359013b3f 100644 (file)
@@ -34,12 +34,12 @@ public class Fallback extends CommonBase {
        }
 
        public final static class SegWitProgram extends Fallback {
-               public final org.ldk.util.UInt5 version;
+               public final org.ldk.util.WitnessVersion version;
                public final byte[] program;
                private SegWitProgram(long ptr, bindings.LDKFallback.SegWitProgram obj) {
                        super(null, ptr);
                        byte version = obj.version;
-                       UInt5 version_conv = new UInt5(version);
+                       WitnessVersion version_conv = new WitnessVersion(version);
                        this.version = version_conv;
                        this.program = obj.program;
                }
@@ -72,20 +72,20 @@ public class Fallback extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Fallback ret_hu_conv = org.ldk.structs.Fallback.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
        /**
         * Utility method to constructs a new SegWitProgram-variant Fallback
         */
-       public static Fallback seg_wit_program(UInt5 version, byte[] program) {
+       public static Fallback seg_wit_program(org.ldk.util.WitnessVersion version, byte[] program) {
                long ret = bindings.Fallback_seg_wit_program(version.getVal(), program);
                Reference.reachabilityFence(version);
                Reference.reachabilityFence(program);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Fallback ret_hu_conv = org.ldk.structs.Fallback.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -97,7 +97,7 @@ public class Fallback extends CommonBase {
                Reference.reachabilityFence(a);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Fallback ret_hu_conv = org.ldk.structs.Fallback.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -109,12 +109,12 @@ public class Fallback extends CommonBase {
                Reference.reachabilityFence(a);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Fallback ret_hu_conv = org.ldk.structs.Fallback.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
        /**
-        * Checks if two Fallbacks contain equal inner contents.
+        * Generates a non-cryptographic 64-bit hash of the Fallback.
         */
        public long hash() {
                long ret = bindings.Fallback_hash(this.ptr);
@@ -129,8 +129,8 @@ public class Fallback extends CommonBase {
         * Checks if two Fallbacks contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
         */
-       public boolean eq(Fallback b) {
-               boolean ret = bindings.Fallback_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+       public boolean eq(org.ldk.structs.Fallback b) {
+               boolean ret = bindings.Fallback_eq(this.ptr, b.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(b);
                return ret;