X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FFixedPenaltyScorer.java;h=c2e427d1ac23ecd236bb7be4c4da708915abc3e5;hp=ca8b6acb6a05ca45433aa88248228256ff3786da;hb=ff3dacec3be60f870d81f6df11bd9fff92aa6047;hpb=1ef2dc8b8a3e0e244ad82ac08e286df489eca4b7 diff --git a/src/main/java/org/ldk/structs/FixedPenaltyScorer.java b/src/main/java/org/ldk/structs/FixedPenaltyScorer.java index ca8b6acb..c2e427d1 100644 --- a/src/main/java/org/ldk/structs/FixedPenaltyScorer.java +++ b/src/main/java/org/ldk/structs/FixedPenaltyScorer.java @@ -38,26 +38,6 @@ public class FixedPenaltyScorer extends CommonBase { return ret_hu_conv; } - /** - * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read - */ - public byte[] write() { - byte[] ret = bindings.FixedPenaltyScorer_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write - */ - public static Result_FixedPenaltyScorerDecodeErrorZ read(byte[] ser) { - long ret = bindings.FixedPenaltyScorer_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_FixedPenaltyScorerDecodeErrorZ ret_hu_conv = Result_FixedPenaltyScorerDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Creates a new scorer using `penalty_msat`. */ @@ -83,4 +63,25 @@ public class FixedPenaltyScorer extends CommonBase { return ret_hu_conv; } + /** + * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read + */ + public byte[] write() { + byte[] ret = bindings.FixedPenaltyScorer_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write + */ + public static Result_FixedPenaltyScorerDecodeErrorZ read(byte[] ser, long arg) { + long ret = bindings.FixedPenaltyScorer_read(ser, arg); + Reference.reachabilityFence(ser); + Reference.reachabilityFence(arg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_FixedPenaltyScorerDecodeErrorZ ret_hu_conv = Result_FixedPenaltyScorerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + }