X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUpdateFee.java;h=d5f5a6e64bf175a16f3e316b94fb23724dab6426;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=0edfefcf99140de04527a43e9687d8df9305d987;hpb=1b870a3ffab1c0024411e30102bc6d198300f095;p=ldk-java diff --git a/src/main/java/org/ldk/structs/UpdateFee.java b/src/main/java/org/ldk/structs/UpdateFee.java index 0edfefcf..d5f5a6e6 100644 --- a/src/main/java/org/ldk/structs/UpdateFee.java +++ b/src/main/java/org/ldk/structs/UpdateFee.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; /** @@ -51,9 +52,10 @@ public class UpdateFee extends CommonBase { /** * Constructs a new UpdateFee given each field */ - public static UpdateFee constructor_new(byte[] channel_id_arg, int feerate_per_kw_arg) { + public static UpdateFee of(byte[] channel_id_arg, int feerate_per_kw_arg) { long ret = bindings.UpdateFee_new(channel_id_arg, feerate_per_kw_arg); - UpdateFee ret_hu_conv = new UpdateFee(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFee(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -63,7 +65,8 @@ public class UpdateFee extends CommonBase { */ public UpdateFee clone() { long ret = bindings.UpdateFee_clone(this.ptr); - UpdateFee ret_hu_conv = new UpdateFee(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFee(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -79,8 +82,9 @@ public class UpdateFee extends CommonBase { /** * Read a UpdateFee from a byte array, created by UpdateFee_write */ - public static Result_UpdateFeeDecodeErrorZ constructor_read(byte[] ser) { + public static Result_UpdateFeeDecodeErrorZ read(byte[] ser) { long ret = bindings.UpdateFee_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }