X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FSignedRawInvoice.java;h=0b976307005baeb9fda4cee407b5ace4bc506a13;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=45bf92d57456185eb902740980f4fe72a80d1e17;hpb=b6cc0960eaee5a5bbc7fde79a56152d6dcd649d8;p=ldk-java diff --git a/src/main/java/org/ldk/structs/SignedRawInvoice.java b/src/main/java/org/ldk/structs/SignedRawInvoice.java index 45bf92d5..0b976307 100644 --- a/src/main/java/org/ldk/structs/SignedRawInvoice.java +++ b/src/main/java/org/ldk/structs/SignedRawInvoice.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; /** @@ -38,7 +39,8 @@ public class SignedRawInvoice extends CommonBase { */ public SignedRawInvoice clone() { long ret = bindings.SignedRawInvoice_clone(this.ptr); - SignedRawInvoice ret_hu_conv = new SignedRawInvoice(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new SignedRawInvoice(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -49,22 +51,13 @@ public class SignedRawInvoice extends CommonBase { * 2. hash of the raw invoice * 3. signature */ - public ThreeTuple into_parts() { + public ThreeTuple_RawInvoice_u832InvoiceSignatureZ into_parts() { long ret = bindings.SignedRawInvoice_into_parts(this.ptr); - long ret_a = bindings.LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(ret); - RawInvoice ret_a_hu_conv = new RawInvoice(null, ret_a); - ret_a_hu_conv.ptrs_to.add(this);; - byte[] ret_b = bindings.LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(ret); - long ret_c = bindings.LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(ret); - InvoiceSignature ret_c_hu_conv = new InvoiceSignature(null, ret_c); - ret_c_hu_conv.ptrs_to.add(this);; - ThreeTuple ret_conv = new ThreeTuple(ret_a_hu_conv, ret_b, ret_c_hu_conv, () -> { - bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(ret); - }); - ret_a_hu_conv.ptrs_to.add(ret_conv); - ret_c_hu_conv.ptrs_to.add(ret_conv); - this.ptrs_to.add(this); - return ret_conv; + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret); + ret_hu_conv.ptrs_to.add(this); + ; + return ret_hu_conv; } /** @@ -72,7 +65,8 @@ public class SignedRawInvoice extends CommonBase { */ public RawInvoice raw_invoice() { long ret = bindings.SignedRawInvoice_raw_invoice(this.ptr); - RawInvoice ret_hu_conv = new RawInvoice(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -90,7 +84,8 @@ public class SignedRawInvoice extends CommonBase { */ public InvoiceSignature signature() { long ret = bindings.SignedRawInvoice_signature(this.ptr); - InvoiceSignature ret_hu_conv = new InvoiceSignature(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceSignature(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -100,6 +95,7 @@ public class SignedRawInvoice extends CommonBase { */ public Result_PayeePubKeyErrorZ recover_payee_pub_key() { long ret = bindings.SignedRawInvoice_recover_payee_pub_key(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -116,8 +112,9 @@ public class SignedRawInvoice extends CommonBase { /** * Read a SignedRawInvoice object from a string */ - public static Result_SignedRawInvoiceNoneZ from_str(String s) { + public static Result_SignedRawInvoiceNoneZ from_str(java.lang.String s) { long ret = bindings.SignedRawInvoice_from_str(s); + if (ret >= 0 && ret <= 4096) { return null; } Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret); return ret_hu_conv; }