X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FInMemorySigner.java;h=cdfc34ada54b416630b8c787d88bf52648fce278;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=bd38ce700957d2e0816ca7a3247d27813bc54d9e;hpb=6f84978154512148a47502caad48038e3f264392;p=ldk-java diff --git a/src/main/java/org/ldk/structs/InMemorySigner.java b/src/main/java/org/ldk/structs/InMemorySigner.java index bd38ce70..cdfc34ad 100644 --- a/src/main/java/org/ldk/structs/InMemorySigner.java +++ b/src/main/java/org/ldk/structs/InMemorySigner.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; /** @@ -116,7 +117,8 @@ public class InMemorySigner extends CommonBase { */ public InMemorySigner clone() { long ret = bindings.InMemorySigner_clone(this.ptr); - InMemorySigner ret_hu_conv = new InMemorySigner(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -124,9 +126,10 @@ public class InMemorySigner extends CommonBase { /** * Create a new InMemorySigner */ - public static InMemorySigner constructor_new(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id) { + public static InMemorySigner of(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id) { long ret = bindings.InMemorySigner_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, channel_keys_id); - InMemorySigner ret_hu_conv = new InMemorySigner(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -137,7 +140,8 @@ public class InMemorySigner extends CommonBase { */ public ChannelPublicKeys counterparty_pubkeys() { long ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -179,7 +183,8 @@ public class InMemorySigner extends CommonBase { */ public OutPoint funding_outpoint() { long ret = bindings.InMemorySigner_funding_outpoint(this.ptr); - OutPoint ret_hu_conv = new OutPoint(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -192,7 +197,8 @@ public class InMemorySigner extends CommonBase { */ public ChannelTransactionParameters get_channel_parameters() { long ret = bindings.InMemorySigner_get_channel_parameters(this.ptr); - ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTransactionParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -206,6 +212,7 @@ public class InMemorySigner extends CommonBase { */ public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(byte[] spend_tx, long input_idx, StaticPaymentOutputDescriptor descriptor) { long ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); this.ptrs_to.add(descriptor); return ret_hu_conv; @@ -221,6 +228,7 @@ public class InMemorySigner extends CommonBase { */ public Result_CVec_CVec_u8ZZNoneZ sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, DelayedPaymentOutputDescriptor descriptor) { long ret = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); this.ptrs_to.add(descriptor); return ret_hu_conv; @@ -232,6 +240,7 @@ public class InMemorySigner extends CommonBase { */ public BaseSign as_BaseSign() { long ret = bindings.InMemorySigner_as_BaseSign(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } BaseSign ret_hu_conv = new BaseSign(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -243,6 +252,7 @@ public class InMemorySigner extends CommonBase { */ public Sign as_Sign() { long ret = bindings.InMemorySigner_as_Sign(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } Sign ret_hu_conv = new Sign(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -259,8 +269,9 @@ public class InMemorySigner extends CommonBase { /** * Read a InMemorySigner from a byte array, created by InMemorySigner_write */ - public static Result_InMemorySignerDecodeErrorZ constructor_read(byte[] ser) { + public static Result_InMemorySignerDecodeErrorZ read(byte[] ser) { long ret = bindings.InMemorySigner_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }