X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUtilMethods.java;fp=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUtilMethods.java;h=513b48b4191f11278915bf2a256aebadaa9fb610;hb=4a36fa97d4eee96099c4a176ea845c52db27e64c;hp=3ba0b392899f8e37082ff2c16da773ed666af16f;hpb=46763b974f120d1795fca6c1e757578784f3305a;p=ldk-java diff --git a/src/main/java/org/ldk/structs/UtilMethods.java b/src/main/java/org/ldk/structs/UtilMethods.java index 3ba0b392..513b48b4 100644 --- a/src/main/java/org/ldk/structs/UtilMethods.java +++ b/src/main/java/org/ldk/structs/UtilMethods.java @@ -42,50 +42,6 @@ public class UtilMethods { return ret; } - /** - * Read a PathFailure from a byte array, created by PathFailure_write - */ - public static Result_COption_PathFailureZDecodeErrorZ PathFailure_read(byte[] ser) { - long ret = bindings.PathFailure_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a ClosureReason from a byte array, created by ClosureReason_write - */ - public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) { - long ret = bindings.ClosureReason_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a HTLCDestination from a byte array, created by HTLCDestination_write - */ - public static Result_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(byte[] ser) { - long ret = bindings.HTLCDestination_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a Event from a byte array, created by Event_write - */ - public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) { - long ret = bindings.Event_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Read a APIError from a byte array, created by APIError_write */ @@ -550,7 +506,7 @@ public class UtilMethods { * [`ChannelManager::list_usable_channels`] will never include such channels. * * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels - * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph * * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None @@ -596,6 +552,50 @@ public class UtilMethods { return ret_hu_conv; } + /** + * Read a PathFailure from a byte array, created by PathFailure_write + */ + public static Result_COption_PathFailureZDecodeErrorZ PathFailure_read(byte[] ser) { + long ret = bindings.PathFailure_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a ClosureReason from a byte array, created by ClosureReason_write + */ + public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) { + long ret = bindings.ClosureReason_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a HTLCDestination from a byte array, created by HTLCDestination_write + */ + public static Result_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(byte[] ser) { + long ret = bindings.HTLCDestination_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a Event from a byte array, created by Event_write + */ + public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) { + long ret = bindings.Event_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Pays the given [`Invoice`], retrying if needed based on [`Retry`]. *