X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FCommitmentSigned.java;h=85266a6e5943ce6c55edd71590ee8849edaa0d7f;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=35100476bd2f7112cb7042c92a1222fed73cfb8e;hpb=1b870a3ffab1c0024411e30102bc6d198300f095;p=ldk-java diff --git a/src/main/java/org/ldk/structs/CommitmentSigned.java b/src/main/java/org/ldk/structs/CommitmentSigned.java index 35100476..85266a6e 100644 --- a/src/main/java/org/ldk/structs/CommitmentSigned.java +++ b/src/main/java/org/ldk/structs/CommitmentSigned.java @@ -4,6 +4,7 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; /** @@ -58,9 +59,10 @@ public class CommitmentSigned extends CommonBase { /** * Constructs a new CommitmentSigned given each field */ - public static CommitmentSigned constructor_new(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) { + public static CommitmentSigned of(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) { long ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg); - CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -70,7 +72,8 @@ public class CommitmentSigned extends CommonBase { */ public CommitmentSigned clone() { long ret = bindings.CommitmentSigned_clone(this.ptr); - CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -86,8 +89,9 @@ public class CommitmentSigned extends CommonBase { /** * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write */ - public static Result_CommitmentSignedDecodeErrorZ constructor_read(byte[] ser) { + public static Result_CommitmentSignedDecodeErrorZ read(byte[] ser) { long ret = bindings.CommitmentSigned_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }