X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fbindings.c;h=6b2129145677a1ef22d912ca1cc5a6628dc8d3ec;hb=c235b1252356e371b27ba8735595c59aaf69c2d1;hp=d0d24f722fdce59e153defba0351d5e0752f835a;hpb=5e9de82b3a7712a41189756d9d16d946142b2ac5;p=ldk-java diff --git a/ts/bindings.c b/ts/bindings.c index d0d24f72..6b212914 100644 --- a/ts/bindings.c +++ b/ts/bindings.c @@ -179,17 +179,19 @@ static inline int32_t LDKCOption_NoneZ_to_js(LDKCOption_NoneZ val) { default: abort(); } } -static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_js(int32_t ord) { +static inline LDKChannelMonitorUpdateStatus LDKChannelMonitorUpdateStatus_from_js(int32_t ord) { switch (ord) { - case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure; - case 1: return LDKChannelMonitorUpdateErr_PermanentFailure; + case 0: return LDKChannelMonitorUpdateStatus_Completed; + case 1: return LDKChannelMonitorUpdateStatus_InProgress; + case 2: return LDKChannelMonitorUpdateStatus_PermanentFailure; } abort(); } -static inline int32_t LDKChannelMonitorUpdateErr_to_js(LDKChannelMonitorUpdateErr val) { +static inline int32_t LDKChannelMonitorUpdateStatus_to_js(LDKChannelMonitorUpdateStatus val) { switch (val) { - case LDKChannelMonitorUpdateErr_TemporaryFailure: return 0; - case LDKChannelMonitorUpdateErr_PermanentFailure: return 1; + case LDKChannelMonitorUpdateStatus_Completed: return 0; + case LDKChannelMonitorUpdateStatus_InProgress: return 1; + case LDKChannelMonitorUpdateStatus_PermanentFailure: return 2; default: abort(); } } @@ -518,6 +520,25 @@ void __attribute__((export_name("TS_CResult_BlindedRouteNoneZ_get_err"))) TS_CR CResult_BlindedRouteNoneZ_get_err(owner_conv); } +uint32_t __attribute__((export_name("TS_LDKDecodeError_ty_from_ptr"))) TS_LDKDecodeError_ty_from_ptr(uint64_t ptr) { + LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKDecodeError_UnknownVersion: return 0; + case LDKDecodeError_UnknownRequiredFeature: return 1; + case LDKDecodeError_InvalidValue: return 2; + case LDKDecodeError_ShortRead: return 3; + case LDKDecodeError_BadLengthDescriptor: return 4; + case LDKDecodeError_Io: return 5; + case LDKDecodeError_UnsupportedCompression: return 6; + default: abort(); + } +} +uint32_t __attribute__((export_name("TS_LDKDecodeError_Io_get_io"))) TS_LDKDecodeError_Io_get_io(uint64_t ptr) { + LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr); + assert(obj->tag == LDKDecodeError_Io); + uint32_t io_conv = LDKIOError_to_js(obj->io); + return io_conv; +} static inline struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){ LDKBlindedRoute ret = *owner->contents.result; ret.is_owned = false; @@ -533,16 +554,14 @@ uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_get_ok } static inline struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_get_err"))) TS_CResult_BlindedRouteDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -561,16 +580,14 @@ uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_get_ok") } static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_get_err"))) TS_CResult_BlindedHopDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -607,16 +624,14 @@ uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDe } static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -677,16 +692,14 @@ uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_ } static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -705,16 +718,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_g } static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -771,16 +782,14 @@ uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr } static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -799,16 +808,14 @@ uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP } static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -827,16 +834,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec } static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -855,16 +860,14 @@ uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco } static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -883,16 +886,14 @@ uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod } static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -934,16 +935,14 @@ uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro } static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1013,16 +1012,14 @@ uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_ } static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1069,16 +1066,14 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) } static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1111,16 +1106,14 @@ uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_ok"))) TS } static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_err"))) TS_CResult_RouteDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1139,16 +1132,14 @@ uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get } static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_err"))) TS_CResult_RouteParametersDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1193,16 +1184,14 @@ uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_g } static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_err"))) TS_CResult_PaymentParametersDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1228,16 +1217,14 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_ok")) } static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_err"))) TS_CResult_RouteHintDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteHintDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1256,16 +1243,14 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_ok } static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_err"))) TS_CResult_RouteHintHopDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1346,16 +1331,14 @@ uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_ } static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1414,16 +1397,14 @@ uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr } static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1490,16 +1471,14 @@ uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeE } static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2062,16 +2041,14 @@ uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_ } static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_err"))) TS_CResult_COption_EventZDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2535,31 +2512,12 @@ static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) { } return ret; } -static inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok(uint64_t owner) { - LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner); - CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv); -} - -static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return ChannelMonitorUpdateErr_clone(&*owner->contents.err); -} -uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_err(uint64_t owner) { - LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner); - uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv)); - return ret_conv; -} - uint32_t __attribute__((export_name("TS_LDKMonitorEvent_ty_from_ptr"))) TS_LDKMonitorEvent_ty_from_ptr(uint64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); switch(obj->tag) { case LDKMonitorEvent_HTLCEvent: return 0; case LDKMonitorEvent_CommitmentTxConfirmed: return 1; - case LDKMonitorEvent_UpdateCompleted: return 2; + case LDKMonitorEvent_Completed: return 2; case LDKMonitorEvent_UpdateFailed: return 3; default: abort(); } @@ -2582,19 +2540,19 @@ uint64_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_ge commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false); return commitment_tx_confirmed_ref; } -uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo"))) TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKMonitorEvent_Completed_get_funding_txo"))) TS_LDKMonitorEvent_Completed_get_funding_txo(uint64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); - assert(obj->tag == LDKMonitorEvent_UpdateCompleted); - LDKOutPoint funding_txo_var = obj->update_completed.funding_txo; + assert(obj->tag == LDKMonitorEvent_Completed); + LDKOutPoint funding_txo_var = obj->completed.funding_txo; uint64_t funding_txo_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = tag_ptr(funding_txo_var.inner, false); return funding_txo_ref; } -int64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id"))) TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(uint64_t ptr) { +int64_t __attribute__((export_name("TS_LDKMonitorEvent_Completed_get_monitor_update_id"))) TS_LDKMonitorEvent_Completed_get_monitor_update_id(uint64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); - assert(obj->tag == LDKMonitorEvent_UpdateCompleted); - int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id; + assert(obj->tag == LDKMonitorEvent_Completed); + int64_t monitor_update_id_conv = obj->completed.monitor_update_id; return monitor_update_id_conv; } uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_failed"))) TS_LDKMonitorEvent_UpdateFailed_get_update_failed(uint64_t ptr) { @@ -2679,16 +2637,14 @@ uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_ } static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2788,16 +2744,14 @@ uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ } static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2816,16 +2770,14 @@ uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok } static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_err"))) TS_CResult_InitFeaturesDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2844,16 +2796,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get } static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2872,16 +2822,14 @@ uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok } static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2900,16 +2848,14 @@ uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get } static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2928,16 +2874,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ } static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2956,16 +2900,14 @@ uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) T } static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) TS_CResult_NodeIdDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NodeIdDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2982,16 +2924,14 @@ uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr } static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3191,16 +3131,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_g } static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3219,16 +3157,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_ok" } static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelInfoDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3247,16 +3183,14 @@ uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_ok" } static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_err"))) TS_CResult_RoutingFeesDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3366,16 +3300,14 @@ uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError } static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3394,16 +3326,14 @@ uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_ok")) } static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_err"))) TS_CResult_NodeAliasDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3422,16 +3352,14 @@ uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_ok"))) } static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_err"))) TS_CResult_NodeInfoDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3450,16 +3378,14 @@ uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_ok } static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_err"))) TS_CResult_NetworkGraphDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3500,16 +3426,14 @@ uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD } static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3528,16 +3452,14 @@ uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe } static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3554,16 +3476,14 @@ uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode } static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -3702,6 +3622,26 @@ void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_err"))) TS_CResu CResult_SecretKeyNoneZ_get_err(owner_conv); } +static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +int8_tArray __attribute__((export_name("TS_CResult_PublicKeyNoneZ_get_ok"))) TS_CResult_PublicKeyNoneZ_get_ok(uint64_t owner) { + LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, CResult_PublicKeyNoneZ_get_ok(owner_conv).compressed_form, 33); + return ret_arr; +} + +static inline void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void __attribute__((export_name("TS_CResult_PublicKeyNoneZ_get_err"))) TS_CResult_PublicKeyNoneZ_get_err(uint64_t owner) { + LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner); + CResult_PublicKeyNoneZ_get_err(owner_conv); +} + uint32_t __attribute__((export_name("TS_LDKCOption_ScalarZ_ty_from_ptr"))) TS_LDKCOption_ScalarZ_ty_from_ptr(uint64_t ptr) { LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr); switch(obj->tag) { @@ -3923,6 +3863,20 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* FREE(untag_ptr(ret)); return ret_conv; } +LDKCResult_SignatureNoneZ sign_holder_anchor_input_LDKBaseSign_jcall(const void* this_arg, LDKTransaction anchor_tx, uintptr_t input) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; + LDKTransaction anchor_tx_var = anchor_tx; + int8_tArray anchor_tx_arr = init_int8_tArray(anchor_tx_var.datalen, __LINE__); + memcpy(anchor_tx_arr->elems, anchor_tx_var.data, anchor_tx_var.datalen); + Transaction_free(anchor_tx_var); + uint32_t input_conv = input; + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 13, (uint32_t)anchor_tx_arr, input_conv, 0, 0, 0, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKUnsignedChannelAnnouncement msg_var = *msg; @@ -3930,7 +3884,7 @@ LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSig msg_var = UnsignedChannelAnnouncement_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 13, msg_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 14, msg_ref, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr); @@ -3944,7 +3898,7 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var); channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned); - js_invoke_function_buuuuu(j_calls->instance_ptr, 14, channel_parameters_ref, 0, 0, 0, 0, 0); + js_invoke_function_buuuuu(j_calls->instance_ptr, 15, channel_parameters_ref, 0, 0, 0, 0, 0); } static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg; @@ -3973,6 +3927,7 @@ static inline LDKBaseSign LDKBaseSign_init (JSValue o, uint64_t pubkeys) { .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall, .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall, .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall, + .sign_holder_anchor_input = sign_holder_anchor_input_LDKBaseSign_jcall, .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall, .ready_channel = ready_channel_LDKBaseSign_jcall, .free = LDKBaseSign_JCalls_free, @@ -4175,6 +4130,20 @@ uint64_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) T return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_BaseSign_sign_holder_anchor_input"))) TS_BaseSign_sign_holder_anchor_input(uint64_t this_arg, int8_tArray anchor_tx, uint32_t input) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; + LDKTransaction anchor_tx_ref; + anchor_tx_ref.datalen = anchor_tx->arr_len; + anchor_tx_ref.data = MALLOC(anchor_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(anchor_tx_ref.data, anchor_tx->elems, anchor_tx_ref.datalen); FREE(anchor_tx); + anchor_tx_ref.data_is_owned = true; + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_holder_anchor_input)(this_arg_conv->this_arg, anchor_tx_ref, input); + return tag_ptr(ret_conv, true); +} + uint64_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) TS_BaseSign_sign_channel_announcement(uint64_t this_arg, uint64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -4230,7 +4199,7 @@ static void LDKSign_JCalls_free(void* this_arg) { } LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) { LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 15, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 16, 0, 0, 0, 0, 0, 0); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -4290,16 +4259,14 @@ uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_ok"))) TS_ } static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_err"))) TS_CResult_SignDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_SignDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -4376,16 +4343,14 @@ uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_ } static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_err"))) TS_CResult_InMemorySignerDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -4438,7 +4403,7 @@ uint32_t __attribute__((export_name("TS_LDKAPIError_ty_from_ptr"))) TS_LDKAPIErr case LDKAPIError_FeeRateTooHigh: return 1; case LDKAPIError_RouteError: return 2; case LDKAPIError_ChannelUnavailable: return 3; - case LDKAPIError_MonitorUpdateFailed: return 4; + case LDKAPIError_MonitorUpdateInProgress: return 4; case LDKAPIError_IncompatibleShutdownScript: return 5; default: abort(); } @@ -4860,16 +4825,14 @@ uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecod } static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -4888,16 +4851,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ } static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -4916,16 +4877,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_ } static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -4944,16 +4903,14 @@ uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_g } static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -4974,7 +4931,7 @@ static void LDKWatch_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) { +LDKChannelMonitorUpdateStatus watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; LDKOutPoint funding_txo_var = funding_txo; uint64_t funding_txo_ref = 0; @@ -4984,14 +4941,11 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t monitor_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); - uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 16, funding_txo_ref, monitor_ref, 0, 0, 0, 0); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - FREE(untag_ptr(ret)); + uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 17, funding_txo_ref, monitor_ref, 0, 0, 0, 0); + LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret); return ret_conv; } -LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) { +LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; LDKOutPoint funding_txo_var = funding_txo; uint64_t funding_txo_ref = 0; @@ -5001,16 +4955,13 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t update_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = tag_ptr(update_var.inner, update_var.is_owned); - uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 17, funding_txo_ref, update_ref, 0, 0, 0, 0); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - FREE(untag_ptr(ret)); + uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 18, funding_txo_ref, update_ref, 0, 0, 0, 0); + LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret); return ret_conv; } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; - uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 18, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 19, 0, 0, 0, 0, 0, 0); LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -5052,7 +5003,7 @@ uint64_t __attribute__((export_name("TS_LDKWatch_new"))) TS_LDKWatch_new(JSValu *res_ptr = LDKWatch_init(o); return tag_ptr(res_ptr, true); } -uint64_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t monitor) { +uint32_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t monitor) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; @@ -5066,12 +5017,11 @@ uint64_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_ monitor_conv.is_owned = ptr_is_owned(monitor); CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); monitor_conv = ChannelMonitor_clone(&monitor_conv); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); - return tag_ptr(ret_conv, true); + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv)); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t update) { +uint32_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t update) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; @@ -5085,9 +5035,8 @@ uint64_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_updat update_conv.is_owned = ptr_is_owned(update); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); update_conv = ChannelMonitorUpdate_clone(&update_conv); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); - return tag_ptr(ret_conv, true); + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv)); + return ret_conv; } uint64_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_events"))) TS_Watch_release_pending_monitor_events(uint64_t this_arg) { @@ -5124,7 +5073,7 @@ void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, L int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__); memcpy(tx_arr->elems, tx_var.data, tx_var.datalen); Transaction_free(tx_var); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 19, (uint32_t)tx_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, (uint32_t)tx_arr, 0, 0, 0, 0, 0); } static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) { LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg; @@ -5172,13 +5121,23 @@ static void LDKKeysInterface_JCalls_free(void* this_arg) { LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; uint32_t recipient_conv = LDKRecipient_to_js(recipient); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, recipient_conv, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 21, recipient_conv, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } +LDKCResult_PublicKeyNoneZ get_node_id_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + uint32_t recipient_conv = LDKRecipient_to_js(recipient); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 22, recipient_conv, 0, 0, 0, 0, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} LDKCResult_SharedSecretNoneZ ecdh_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient, LDKPublicKey other_key, LDKCOption_ScalarZ tweak) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; uint32_t recipient_conv = LDKRecipient_to_js(recipient); @@ -5187,7 +5146,7 @@ LDKCResult_SharedSecretNoneZ ecdh_LDKKeysInterface_jcall(const void* this_arg, L LDKCOption_ScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ"); *tweak_copy = tweak; uint64_t tweak_ref = tag_ptr(tweak_copy, true); - uint64_t ret = js_invoke_function_uubuuu(j_calls->instance_ptr, 21, recipient_conv, (uint32_t)other_key_arr, tweak_ref, 0, 0, 0); + uint64_t ret = js_invoke_function_uubuuu(j_calls->instance_ptr, 23, recipient_conv, (uint32_t)other_key_arr, tweak_ref, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SharedSecretNoneZ ret_conv = *(LDKCResult_SharedSecretNoneZ*)(ret_ptr); @@ -5196,7 +5155,7 @@ LDKCResult_SharedSecretNoneZ ecdh_LDKKeysInterface_jcall(const void* this_arg, L } LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 22, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 24, 0, 0, 0, 0, 0, 0); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -5205,7 +5164,7 @@ LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) } LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 23, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 25, 0, 0, 0, 0, 0, 0); LDKShutdownScript ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -5216,7 +5175,7 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; jboolean inbound_conv = inbound; int64_t channel_value_satoshis_conv = channel_value_satoshis; - uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 24, inbound_conv, channel_value_satoshis_conv, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 26, inbound_conv, channel_value_satoshis_conv, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKSign ret_conv = *(LDKSign*)(ret_ptr); @@ -5225,7 +5184,7 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb } LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 25, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 27, 0, 0, 0, 0, 0, 0); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -5236,7 +5195,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* LDKu8slice reader_var = reader; int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__); memcpy(reader_arr->elems, reader_var.data, reader_var.datalen); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 26, (uint32_t)reader_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 28, (uint32_t)reader_arr, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr); @@ -5259,7 +5218,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v FREE(invoice_data_var.data); uint32_t receipient_conv = LDKRecipient_to_js(receipient); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 27, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, receipient_conv, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 29, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, receipient_conv, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); @@ -5268,7 +5227,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v } LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 28, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 30, 0, 0, 0, 0, 0, 0); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -5286,6 +5245,7 @@ static inline LDKKeysInterface LDKKeysInterface_init (JSValue o) { LDKKeysInterface ret = { .this_arg = (void*) calls, .get_node_secret = get_node_secret_LDKKeysInterface_jcall, + .get_node_id = get_node_id_LDKKeysInterface_jcall, .ecdh = ecdh_LDKKeysInterface_jcall, .get_destination_script = get_destination_script_LDKKeysInterface_jcall, .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall, @@ -5313,6 +5273,16 @@ uint64_t __attribute__((export_name("TS_KeysInterface_get_node_secret"))) TS_Ke return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_KeysInterface_get_node_id"))) TS_KeysInterface_get_node_id(uint64_t this_arg, uint32_t recipient) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; + LDKRecipient recipient_conv = LDKRecipient_from_js(recipient); + LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ"); + *ret_conv = (this_arg_conv->get_node_id)(this_arg_conv->this_arg, recipient_conv); + return tag_ptr(ret_conv, true); +} + uint64_t __attribute__((export_name("TS_KeysInterface_ecdh"))) TS_KeysInterface_ecdh(uint64_t this_arg, uint32_t recipient, int8_tArray other_key, uint64_t tweak) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -5432,7 +5402,7 @@ static void LDKFeeEstimator_JCalls_free(void* this_arg) { uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) { LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target); - return js_invoke_function_uuuuuu(j_calls->instance_ptr, 29, confirmation_target_conv, 0, 0, 0, 0, 0); + return js_invoke_function_uuuuuu(j_calls->instance_ptr, 31, confirmation_target_conv, 0, 0, 0, 0, 0); } static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) { LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg; @@ -5499,16 +5469,14 @@ uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManager } static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5527,16 +5495,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_o } static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_err"))) TS_CResult_ChannelConfigDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5555,16 +5521,14 @@ uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_ok"))) } static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_err"))) TS_CResult_OutPointDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OutPointDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5580,17 +5544,17 @@ static void LDKType_JCalls_free(void* this_arg) { } uint16_t type_id_LDKType_jcall(const void* this_arg) { LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg; - return js_invoke_function_uuuuuu(j_calls->instance_ptr, 30, 0, 0, 0, 0, 0, 0); + return js_invoke_function_uuuuuu(j_calls->instance_ptr, 32, 0, 0, 0, 0, 0, 0); } LDKStr debug_str_LDKType_jcall(const void* this_arg) { LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg; - jstring ret = (jstring)js_invoke_function_uuuuuu(j_calls->instance_ptr, 31, 0, 0, 0, 0, 0, 0); + jstring ret = (jstring)js_invoke_function_uuuuuu(j_calls->instance_ptr, 33, 0, 0, 0, 0, 0, 0); LDKStr ret_conv = str_ref_to_owned_c(ret); return ret_conv; } LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) { LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 32, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 34, 0, 0, 0, 0, 0, 0); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -5678,16 +5642,14 @@ uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_o } static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_err"))) TS_CResult_COption_TypeZDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5760,16 +5722,14 @@ uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_get_o } static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_get_err"))) TS_CResult_InFlightHtlcsDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6142,16 +6102,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError } static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6182,16 +6140,14 @@ uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro } static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6210,16 +6166,14 @@ uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok") } static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6497,16 +6451,14 @@ uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor } static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6537,6 +6489,110 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } +typedef struct LDKCustomOnionMessageContents_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKCustomOnionMessageContents_JCalls; +static void LDKCustomOnionMessageContents_JCalls_free(void* this_arg) { + LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +uint64_t tlv_type_LDKCustomOnionMessageContents_jcall(const void* this_arg) { + LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg; + return js_invoke_function_uuuuuu(j_calls->instance_ptr, 35, 0, 0, 0, 0, 0, 0); +} +LDKCVec_u8Z write_LDKCustomOnionMessageContents_jcall(const void* this_arg) { + LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg; + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 36, 0, 0, 0, 0, 0, 0); + LDKCVec_u8Z ret_ref; + ret_ref.datalen = ret->arr_len; + ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); + return ret_ref; +} +static void LDKCustomOnionMessageContents_JCalls_cloned(LDKCustomOnionMessageContents* new_obj) { + LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKCustomOnionMessageContents LDKCustomOnionMessageContents_init (JSValue o) { + LDKCustomOnionMessageContents_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageContents_JCalls), "LDKCustomOnionMessageContents_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKCustomOnionMessageContents ret = { + .this_arg = (void*) calls, + .tlv_type = tlv_type_LDKCustomOnionMessageContents_jcall, + .write = write_LDKCustomOnionMessageContents_jcall, + .cloned = LDKCustomOnionMessageContents_JCalls_cloned, + .free = LDKCustomOnionMessageContents_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKCustomOnionMessageContents_new"))) TS_LDKCustomOnionMessageContents_new(JSValue o) { + LDKCustomOnionMessageContents *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents"); + *res_ptr = LDKCustomOnionMessageContents_init(o); + return tag_ptr(res_ptr, true); +} +int64_t __attribute__((export_name("TS_CustomOnionMessageContents_tlv_type"))) TS_CustomOnionMessageContents_tlv_type(uint64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr; + int64_t ret_conv = (this_arg_conv->tlv_type)(this_arg_conv->this_arg); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_CustomOnionMessageContents_write"))) TS_CustomOnionMessageContents_write(uint64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr; + LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +uint32_t __attribute__((export_name("TS_LDKCOption_CustomOnionMessageContentsZ_ty_from_ptr"))) TS_LDKCOption_CustomOnionMessageContentsZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_CustomOnionMessageContentsZ_Some: return 0; + case LDKCOption_CustomOnionMessageContentsZ_None: return 1; + default: abort(); + } +} +uint64_t __attribute__((export_name("TS_LDKCOption_CustomOnionMessageContentsZ_Some_get_some"))) TS_LDKCOption_CustomOnionMessageContentsZ_Some_get_some(uint64_t ptr) { + LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_CustomOnionMessageContentsZ_Some); + LDKCustomOnionMessageContents* some_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents"); + *some_ret = CustomOnionMessageContents_clone(&obj->some); + return tag_ptr(some_ret, true); +} +static inline struct LDKCOption_CustomOnionMessageContentsZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_CustomOnionMessageContentsZ_clone(&*owner->contents.result); +} +uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint32_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_ty_from_ptr"))) TS_LDKCOption_NetAddressZ_ty_from_ptr(uint64_t ptr) { LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr); switch(obj->tag) { @@ -6632,7 +6688,8 @@ uint32_t __attribute__((export_name("TS_LDKSendError_ty_from_ptr"))) TS_LDKSendE case LDKSendError_TooBigPacket: return 1; case LDKSendError_TooFewBlindedHops: return 2; case LDKSendError_InvalidFirstHop: return 3; - case LDKSendError_BufferFull: return 4; + case LDKSendError_InvalidMessage: return 4; + case LDKSendError_BufferFull: return 5; default: abort(); } } @@ -6674,10 +6731,7 @@ uint32_t __attribute__((export_name("TS_LDKGraphSyncError_ty_from_ptr"))) TS_LDK uint64_t __attribute__((export_name("TS_LDKGraphSyncError_DecodeError_get_decode_error"))) TS_LDKGraphSyncError_DecodeError_get_decode_error(uint64_t ptr) { LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr); assert(obj->tag == LDKGraphSyncError_DecodeError); - LDKDecodeError decode_error_var = obj->decode_error; - uint64_t decode_error_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(decode_error_var); - decode_error_ref = tag_ptr(decode_error_var.inner, false); + uint64_t decode_error_ref = tag_ptr(&obj->decode_error, false); return decode_error_ref; } uint64_t __attribute__((export_name("TS_LDKGraphSyncError_LightningError_get_lightning_error"))) TS_LDKGraphSyncError_LightningError_get_lightning_error(uint64_t ptr) { @@ -6743,16 +6797,14 @@ uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok") } static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NetAddressDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6799,16 +6851,14 @@ uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_o } static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6827,16 +6877,14 @@ uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr } static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6855,16 +6903,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ } static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6883,16 +6929,14 @@ uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_o } static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6911,16 +6955,14 @@ uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro } static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6939,16 +6981,14 @@ uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ge } static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6967,16 +7007,14 @@ uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_ } static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_err"))) TS_CResult_FundingCreatedDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -6995,16 +7033,14 @@ uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_o } static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_err"))) TS_CResult_FundingSignedDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7023,16 +7059,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_ok } static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_err"))) TS_CResult_ChannelReadyDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7051,16 +7085,14 @@ uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_ok"))) TS_ } static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_err"))) TS_CResult_InitDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InitDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7079,16 +7111,14 @@ uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_ok" } static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_err"))) TS_CResult_OpenChannelDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7107,16 +7137,14 @@ uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_ok } static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7135,16 +7163,14 @@ uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_ok"))) } static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_err"))) TS_CResult_ShutdownDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ShutdownDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7163,16 +7189,14 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ } static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7191,16 +7215,14 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr } static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7219,16 +7241,14 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_ok")) } static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_err"))) TS_CResult_UpdateFeeDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7247,16 +7267,14 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_g } static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7275,16 +7293,14 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_o } static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7303,16 +7319,14 @@ uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_get_ok } static inline struct LDKDecodeError CResult_OnionMessageDecodeErrorZ_get_err(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_get_err"))) TS_CResult_OnionMessageDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7331,16 +7345,14 @@ uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_ok"))) TS_ } static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_err"))) TS_CResult_PingDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_PingDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7359,16 +7371,14 @@ uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_ok"))) TS_ } static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_err"))) TS_CResult_PongDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_PongDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7387,16 +7397,14 @@ uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco } static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7415,16 +7423,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ } static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7443,16 +7449,14 @@ uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro } static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7471,16 +7475,14 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_o } static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7499,16 +7501,14 @@ uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_ok } static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_err"))) TS_CResult_ErrorMessageDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7527,16 +7527,14 @@ uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_ } static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_err"))) TS_CResult_WarningMessageDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7555,16 +7553,14 @@ uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE } static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7583,16 +7579,14 @@ uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ge } static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7611,16 +7605,14 @@ uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError } static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7639,16 +7631,14 @@ uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr } static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7667,16 +7657,14 @@ uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_g } static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7695,16 +7683,14 @@ uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_g } static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7723,16 +7709,14 @@ uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro } static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){ - LDKDecodeError ret = *owner->contents.err; - ret.is_owned = false; - return ret; +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err(uint64_t owner) { LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7793,7 +7777,7 @@ void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32 LDKu8slice script_pubkey_var = script_pubkey; int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__); memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 33, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 37, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr, 0, 0, 0, 0); } void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; @@ -7801,7 +7785,7 @@ void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput outp uint64_t output_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); output_ref = tag_ptr(output_var.inner, output_var.is_owned); - js_invoke_function_buuuuu(j_calls->instance_ptr, 34, output_ref, 0, 0, 0, 0, 0); + js_invoke_function_buuuuu(j_calls->instance_ptr, 38, output_ref, 0, 0, 0, 0, 0); } static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg; @@ -7914,7 +7898,7 @@ static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) { } LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) { LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; - uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 35, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 39, 0, 0, 0, 0, 0, 0); LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -7987,7 +7971,7 @@ LDKOnionMessage next_onion_message_for_peer_LDKOnionMessageProvider_jcall(const LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg; int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(peer_node_id_arr->elems, peer_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 36, (uint32_t)peer_node_id_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 40, (uint32_t)peer_node_id_arr, 0, 0, 0, 0, 0); LDKOnionMessage ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -8044,7 +8028,7 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * e LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion"); *ret_event = Event_clone(event); uint64_t ref_event = tag_ptr(ret_event, true); - js_invoke_function_buuuuu(j_calls->instance_ptr, 37, ref_event, 0, 0, 0, 0, 0); + js_invoke_function_buuuuu(j_calls->instance_ptr, 41, ref_event, 0, 0, 0, 0, 0); } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -8089,7 +8073,7 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *handler_ret = handler; - js_invoke_function_buuuuu(j_calls->instance_ptr, 38, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0); + js_invoke_function_buuuuu(j_calls->instance_ptr, 42, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0); } static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) { LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg; @@ -8153,7 +8137,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor uint64_t usage_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var); usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned); - return js_invoke_function_bbbbuu(j_calls->instance_ptr, 39, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0); + return js_invoke_function_bbbbuu(j_calls->instance_ptr, 43, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0); } void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; @@ -8171,7 +8155,7 @@ void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, FREE(path_var.data); int64_t short_channel_id_conv = short_channel_id; - js_invoke_function_ubuuuu(j_calls->instance_ptr, 40, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 44, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); } void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) { LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; @@ -8188,7 +8172,7 @@ void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ pa } FREE(path_var.data); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 41, (uint32_t)path_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 45, (uint32_t)path_arr, 0, 0, 0, 0, 0); } void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; @@ -8206,7 +8190,7 @@ void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_ FREE(path_var.data); int64_t short_channel_id_conv = short_channel_id; - js_invoke_function_ubuuuu(j_calls->instance_ptr, 42, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 46, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); } void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) { LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; @@ -8223,11 +8207,11 @@ void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) { } FREE(path_var.data); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 43, (uint32_t)path_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 47, (uint32_t)path_arr, 0, 0, 0, 0, 0); } LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) { LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 44, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 48, 0, 0, 0, 0, 0, 0); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -8402,7 +8386,7 @@ static void LDKLockableScore_JCalls_free(void* this_arg) { } LDKScore lock_LDKLockableScore_jcall(const void* this_arg) { LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 45, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 49, 0, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScore ret_conv = *(LDKScore*)(ret_ptr); @@ -8456,7 +8440,7 @@ static void LDKWriteableScore_JCalls_free(void* this_arg) { } LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) { LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 46, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, 0, 0, 0, 0, 0, 0); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -8515,7 +8499,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, c // WARNING: we may need a move here but no clone is available for LDKChannelManager CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 47, channel_manager_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 51, channel_manager_ref, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); @@ -8529,7 +8513,7 @@ LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, con // WARNING: we may need a move here but no clone is available for LDKNetworkGraph CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var); network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 48, network_graph_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 52, network_graph_ref, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); @@ -8540,7 +8524,7 @@ LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, co LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_scorer = tag_ptr(scorer, false); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 49, ret_scorer, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 53, ret_scorer, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); @@ -8622,7 +8606,7 @@ static void LDKFutureCallback_JCalls_free(void* this_arg) { } void call_LDKFutureCallback_jcall(const void* this_arg) { LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, 0, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 54, 0, 0, 0, 0, 0, 0); } static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) { LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg; @@ -8678,7 +8662,7 @@ void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_ FREE(txdata_var.data); int32_t height_conv = height; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 51, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 55, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0); } void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; @@ -8686,14 +8670,14 @@ void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uin int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__); memcpy(block_arr->elems, block_var.data, block_var.datalen); int32_t height_conv = height; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 52, (uint32_t)block_arr, height_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 56, (uint32_t)block_arr, height_conv, 0, 0, 0, 0); } void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); int32_t height_conv = height; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 53, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 57, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); } static void LDKListen_JCalls_cloned(LDKListen* new_obj) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; @@ -8793,24 +8777,24 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t FREE(txdata_var.data); int32_t height_conv = height; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 54, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 58, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0); } void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; int8_tArray txid_arr = init_int8_tArray(32, __LINE__); memcpy(txid_arr->elems, *txid, 32); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 55, (uint32_t)txid_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 59, (uint32_t)txid_arr, 0, 0, 0, 0, 0); } void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); int32_t height_conv = height; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 56, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 60, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); } LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - ptrArray ret = (ptrArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 57, 0, 0, 0, 0, 0, 0); + ptrArray ret = (ptrArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 61, 0, 0, 0, 0, 0, 0); LDKCVec_TxidZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -8929,7 +8913,7 @@ static void LDKPersist_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; LDKOutPoint channel_id_var = channel_id; uint64_t channel_id_ref = 0; @@ -8944,14 +8928,11 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t update_id_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned); - uint64_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 58, channel_id_ref, data_ref, update_id_ref, 0, 0, 0); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - FREE(untag_ptr(ret)); + uint64_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 62, channel_id_ref, data_ref, update_id_ref, 0, 0, 0); + LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret); return ret_conv; } -LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; LDKOutPoint channel_id_var = channel_id; uint64_t channel_id_ref = 0; @@ -8971,11 +8952,8 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t update_id_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned); - uint64_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 59, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - FREE(untag_ptr(ret)); + uint64_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 63, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0); + LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret); return ret_conv; } static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) { @@ -9000,7 +8978,7 @@ uint64_t __attribute__((export_name("TS_LDKPersist_new"))) TS_LDKPersist_new(JS *res_ptr = LDKPersist_init(o); return tag_ptr(res_ptr, true); } -uint64_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Persist_persist_new_channel(uint64_t this_arg, uint64_t channel_id, uint64_t data, uint64_t update_id) { +uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Persist_persist_new_channel(uint64_t this_arg, uint64_t channel_id, uint64_t data, uint64_t update_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; @@ -9019,12 +8997,11 @@ uint64_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Pers update_id_conv.is_owned = ptr_is_owned(update_id); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv); - return tag_ptr(ret_conv, true); + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv)); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS_Persist_update_persisted_channel(uint64_t this_arg, uint64_t channel_id, uint64_t update, uint64_t data, uint64_t update_id) { +uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS_Persist_update_persisted_channel(uint64_t this_arg, uint64_t channel_id, uint64_t update, uint64_t data, uint64_t update_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; @@ -9048,9 +9025,8 @@ uint64_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS update_id_conv.is_owned = ptr_is_owned(update_id); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv); - return tag_ptr(ret_conv, true); + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv)); + return ret_conv; } typedef struct LDKChannelMessageHandler_JCalls { @@ -9077,7 +9053,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = OpenChannel_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubbuuu(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0); + js_invoke_function_ubbuuu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0); } void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9092,7 +9068,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = AcceptChannel_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubbuuu(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0); + js_invoke_function_ubbuuu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0); } void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9103,7 +9079,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingCreated_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9114,7 +9090,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingSigned_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9125,7 +9101,7 @@ void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, L msg_var = ChannelReady_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9141,7 +9117,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = Shutdown_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubbuuu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0); + js_invoke_function_ubbuuu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0); } void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9152,7 +9128,7 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ClosingSigned_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9163,7 +9139,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = UpdateAddHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9174,7 +9150,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ msg_var = UpdateFulfillHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9185,7 +9161,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = UpdateFailHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9196,7 +9172,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void msg_var = UpdateFailMalformedHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9207,7 +9183,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = CommitmentSigned_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 75, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9218,7 +9194,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = RevokeAndACK_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 76, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9229,7 +9205,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = UpdateFee_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 77, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9240,16 +9216,16 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t msg_var = AnnouncementSignatures_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 78, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); jboolean no_connection_possible_conv = no_connection_possible; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 75, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 79, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0); } -void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) { +LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); @@ -9258,7 +9234,12 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl msg_var = Init_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 76, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9269,7 +9250,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ msg_var = ChannelReestablish_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 77, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9280,7 +9261,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ChannelUpdate_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 78, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9291,11 +9272,11 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic msg_var = ErrorMessage_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 79, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 83, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 80, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 84, 0, 0, 0, 0, 0, 0); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -9306,7 +9287,7 @@ LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 85, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -9608,7 +9589,7 @@ void __attribute__((export_name("TS_ChannelMessageHandler_peer_disconnected"))) (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible); } -void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) { +uint64_t __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; @@ -9620,7 +9601,9 @@ void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS msg_conv.is_owned = ptr_is_owned(msg); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv.is_owned = false; - (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + return tag_ptr(ret_conv, true); } void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_reestablish"))) TS_ChannelMessageHandler_handle_channel_reestablish(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) { @@ -9711,7 +9694,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler msg_var = NodeAnnouncement_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 82, msg_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 86, msg_ref, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -9725,7 +9708,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand msg_var = ChannelAnnouncement_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 83, msg_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 87, msg_ref, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -9739,7 +9722,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc msg_var = ChannelUpdate_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 84, msg_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 88, msg_ref, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -9749,7 +9732,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; int64_t starting_point_conv = starting_point; - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 85, starting_point_conv, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 89, starting_point_conv, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr); @@ -9760,14 +9743,14 @@ LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(co LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__); memcpy(starting_point_arr->elems, starting_point.compressed_form, 33); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 86, (uint32_t)starting_point_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 90, (uint32_t)starting_point_arr, 0, 0, 0, 0, 0); LDKNodeAnnouncement ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); return ret_conv; } -void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) { +LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); @@ -9776,7 +9759,12 @@ void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPubl init_var = Init_clone(&init_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); init_ref = tag_ptr(init_var.inner, init_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 87, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 91, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; @@ -9786,7 +9774,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 88, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 92, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -9801,7 +9789,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess uint64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 89, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 93, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -9816,7 +9804,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 90, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 94, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -9831,7 +9819,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH uint64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 91, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 95, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -9840,7 +9828,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH } LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 92, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 96, 0, 0, 0, 0, 0, 0); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -9851,7 +9839,7 @@ LDKInitFeatures provided_init_features_LDKRoutingMessageHandler_jcall(const void LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 93, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 97, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -9959,7 +9947,7 @@ uint64_t __attribute__((export_name("TS_RoutingMessageHandler_get_next_node_ann return ret_ref; } -void __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS_RoutingMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) { +uint64_t __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS_RoutingMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; @@ -9971,7 +9959,9 @@ void __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS init_conv.is_owned = ptr_is_owned(init); CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv); init_conv.is_owned = false; - (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); + return tag_ptr(ret_conv, true); } uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_channel_range"))) TS_RoutingMessageHandler_handle_reply_channel_range(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) { @@ -10087,9 +10077,9 @@ void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDK msg_var = OnionMessage_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 94, (uint32_t)peer_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 98, (uint32_t)peer_node_id_arr, msg_ref, 0, 0, 0, 0); } -void peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) { +LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); @@ -10098,18 +10088,23 @@ void peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublic init_var = Init_clone(&init_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); init_ref = tag_ptr(init_var.inner, init_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 95, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 99, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); jboolean no_connection_possible_conv = no_connection_possible; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 96, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 100, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0); } LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 97, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 101, 0, 0, 0, 0, 0, 0); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -10120,7 +10115,7 @@ LDKInitFeatures provided_init_features_LDKOnionMessageHandler_jcall(const void* LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 98, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 102, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -10170,7 +10165,7 @@ void __attribute__((export_name("TS_OnionMessageHandler_handle_onion_message")) (this_arg_conv->handle_onion_message)(this_arg_conv->this_arg, peer_node_id_ref, &msg_conv); } -void __attribute__((export_name("TS_OnionMessageHandler_peer_connected"))) TS_OnionMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) { +uint64_t __attribute__((export_name("TS_OnionMessageHandler_peer_connected"))) TS_OnionMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr; @@ -10182,7 +10177,9 @@ void __attribute__((export_name("TS_OnionMessageHandler_peer_connected"))) TS_O init_conv.is_owned = ptr_is_owned(init); CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv); init_conv.is_owned = false; - (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); + return tag_ptr(ret_conv, true); } void __attribute__((export_name("TS_OnionMessageHandler_peer_disconnected"))) TS_OnionMessageHandler_peer_disconnected(uint64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) { @@ -10236,7 +10233,7 @@ LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const voi LDKu8slice buffer_var = buffer; int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__); memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 99, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 103, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); @@ -10294,7 +10291,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca *msg_ret = msg; int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 100, tag_ptr(msg_ret, true), (uint32_t)sender_node_id_arr, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 104, tag_ptr(msg_ret, true), (uint32_t)sender_node_id_arr, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -10303,7 +10300,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca } LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) { LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; - uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 101, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 105, 0, 0, 0, 0, 0, 0); LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -10384,6 +10381,84 @@ uint64_tArray __attribute__((export_name("TS_CustomMessageHandler_get_and_clear return ret_arr; } +typedef struct LDKCustomOnionMessageHandler_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKCustomOnionMessageHandler_JCalls; +static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) { + LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +void handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKCustomOnionMessageContents msg) { + LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; + LDKCustomOnionMessageContents* msg_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents"); + *msg_ret = msg; + js_invoke_function_buuuuu(j_calls->instance_ptr, 106, tag_ptr(msg_ret, true), 0, 0, 0, 0, 0); +} +LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, uint64_t message_type, LDKu8slice buffer) { + LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; + int64_t message_type_conv = message_type; + LDKu8slice buffer_var = buffer; + int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__); + memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 107, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKCustomOnionMessageHandler_JCalls_cloned(LDKCustomOnionMessageHandler* new_obj) { + LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JSValue o) { + LDKCustomOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageHandler_JCalls), "LDKCustomOnionMessageHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKCustomOnionMessageHandler ret = { + .this_arg = (void*) calls, + .handle_custom_message = handle_custom_message_LDKCustomOnionMessageHandler_jcall, + .read_custom_message = read_custom_message_LDKCustomOnionMessageHandler_jcall, + .free = LDKCustomOnionMessageHandler_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKCustomOnionMessageHandler_new"))) TS_LDKCustomOnionMessageHandler_new(JSValue o) { + LDKCustomOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler"); + *res_ptr = LDKCustomOnionMessageHandler_init(o); + return tag_ptr(res_ptr, true); +} +void __attribute__((export_name("TS_CustomOnionMessageHandler_handle_custom_message"))) TS_CustomOnionMessageHandler_handle_custom_message(uint64_t this_arg, uint64_t msg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; + void* msg_ptr = untag_ptr(msg); + CHECK_ACCESS(msg_ptr); + LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr); + if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv); + } + (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv); +} + +uint64_t __attribute__((export_name("TS_CustomOnionMessageHandler_read_custom_message"))) TS_CustomOnionMessageHandler_read_custom_message(uint64_t this_arg, int64_t message_type, int8_tArray buffer) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; + LDKu8slice buffer_ref; + buffer_ref.datalen = buffer->arr_len; + buffer_ref.data = buffer->elems; + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = (this_arg_conv->read_custom_message)(this_arg_conv->this_arg, message_type, buffer_ref); + FREE(buffer); + return tag_ptr(ret_conv, true); +} + typedef struct LDKSocketDescriptor_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -10400,21 +10475,21 @@ uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, b int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__); memcpy(data_arr->elems, data_var.data, data_var.datalen); jboolean resume_read_conv = resume_read; - return js_invoke_function_uuuuuu(j_calls->instance_ptr, 102, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0); + return js_invoke_function_uuuuuu(j_calls->instance_ptr, 108, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0); } void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 103, 0, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 109, 0, 0, 0, 0, 0, 0); } bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *other_arg_clone = SocketDescriptor_clone(other_arg); - return js_invoke_function_buuuuu(j_calls->instance_ptr, 104, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0); + return js_invoke_function_buuuuu(j_calls->instance_ptr, 110, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0); } uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - return js_invoke_function_uuuuuu(j_calls->instance_ptr, 105, 0, 0, 0, 0, 0, 0); + return js_invoke_function_uuuuuu(j_calls->instance_ptr, 111, 0, 0, 0, 0, 0, 0); } static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg; @@ -10576,7 +10651,7 @@ static void LDKPayer_JCalls_free(void* this_arg) { } LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) { LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 106, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 112, 0, 0, 0, 0, 0, 0); LDKPublicKey ret_ref; CHECK(ret->arr_len == 33); memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret); @@ -10584,7 +10659,7 @@ LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) { } LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg; - uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 107, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 113, 0, 0, 0, 0, 0, 0); LDKCVec_ChannelDetailsZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -10614,7 +10689,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* memcpy(payment_hash_arr->elems, payment_hash.data, 32); int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); memcpy(payment_secret_arr->elems, payment_secret.data, 32); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 108, route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 114, route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); @@ -10630,7 +10705,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall( route_ref = tag_ptr(route_var.inner, route_var.is_owned); int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__); memcpy(payment_preimage_arr->elems, payment_preimage.data, 32); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 109, route_ref, (uint32_t)payment_preimage_arr, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 115, route_ref, (uint32_t)payment_preimage_arr, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); @@ -10646,7 +10721,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this route_ref = tag_ptr(route_var.inner, route_var.is_owned); int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, payment_id.data, 32); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 110, route_ref, (uint32_t)payment_id_arr, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 116, route_ref, (uint32_t)payment_id_arr, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); @@ -10657,7 +10732,7 @@ void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes paym LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg; int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, payment_id.data, 32); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 111, (uint32_t)payment_id_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 117, (uint32_t)payment_id_arr, 0, 0, 0, 0, 0); } static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) { LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg; @@ -10818,7 +10893,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, uint64_t inflight_htlcs_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); - uint64_t ret = js_invoke_function_ubuubu(j_calls->instance_ptr, 112, (uint32_t)payer_arr, route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, inflight_htlcs_ref, 0); + uint64_t ret = js_invoke_function_ubuubu(j_calls->instance_ptr, 118, (uint32_t)payer_arr, route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, inflight_htlcs_ref, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); @@ -10841,7 +10916,7 @@ void notify_payment_path_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_Ro FREE(path_var.data); int64_t short_channel_id_conv = short_channel_id; - js_invoke_function_ubuuuu(j_calls->instance_ptr, 113, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 119, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); } void notify_payment_path_successful_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; @@ -10858,7 +10933,7 @@ void notify_payment_path_successful_LDKRouter_jcall(const void* this_arg, LDKCVe } FREE(path_var.data); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 114, (uint32_t)path_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 120, (uint32_t)path_arr, 0, 0, 0, 0, 0); } void notify_payment_probe_successful_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; @@ -10875,7 +10950,7 @@ void notify_payment_probe_successful_LDKRouter_jcall(const void* this_arg, LDKCV } FREE(path_var.data); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 115, (uint32_t)path_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 121, (uint32_t)path_arr, 0, 0, 0, 0, 0); } void notify_payment_probe_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; @@ -10893,7 +10968,7 @@ void notify_payment_probe_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_R FREE(path_var.data); int64_t short_channel_id_conv = short_channel_id; - js_invoke_function_ubuuuu(j_calls->instance_ptr, 116, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 122, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); } static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg; @@ -11246,11 +11321,10 @@ uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_BlindedRouteDecodeErrorZ_err"))) TS_CResult_BlindedRouteDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ"); *ret_conv = CResult_BlindedRouteDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -11284,11 +11358,10 @@ uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_ok"))) T } uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_err"))) TS_CResult_BlindedHopDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -11366,11 +11439,10 @@ uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDe } uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -11519,11 +11591,10 @@ uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok") } uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -11574,11 +11645,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_o } uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -11723,11 +11793,10 @@ uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr } uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -11793,11 +11862,10 @@ uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP } uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -11848,11 +11916,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec } uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -11922,11 +11989,10 @@ uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco } uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -11977,11 +12043,10 @@ uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod } uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12065,11 +12130,10 @@ uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro } uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12213,11 +12277,10 @@ uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok") } uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12323,11 +12386,10 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_ } uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12430,11 +12492,10 @@ uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_ok"))) TS_CRe } uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CResult_RouteDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12485,11 +12546,10 @@ uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok" } uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12619,11 +12679,10 @@ uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_o } uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_err"))) TS_CResult_PaymentParametersDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12694,11 +12753,10 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_ok"))) TS } uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) TS_CResult_RouteHintDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12749,11 +12807,10 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12878,11 +12935,10 @@ uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_ok") } uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -12979,11 +13035,10 @@ uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr } uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -13080,11 +13135,10 @@ uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeE } uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -13248,11 +13302,10 @@ uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok") } uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -13438,52 +13491,6 @@ void __attribute__((export_name("TS_CVec_TxidZ_free"))) TS_CVec_TxidZ_free(ptrA CVec_TxidZ_free(_res_constr); } -uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_ok() { - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok(); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_err(uint32_t e) { - LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_js(e); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint64_t o) { - LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); -} - -static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint64_t arg) { - LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone(uint64_t orig) { - LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(orig); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_MonitorEventZ_free(uint64_tArray _res) { LDKCVec_MonitorEventZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -13593,11 +13600,10 @@ uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_ } uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -13749,11 +13755,10 @@ uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ } uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -13786,11 +13791,10 @@ uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -13841,11 +13845,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok" } uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -13896,11 +13899,10 @@ uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -13951,11 +13953,10 @@ uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok" } uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14006,11 +14007,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ } uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14061,11 +14061,10 @@ uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CR } uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14115,11 +14114,10 @@ uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr } uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14395,11 +14393,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_o } uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14450,11 +14447,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) TS_CResult_ChannelInfoDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14505,11 +14501,10 @@ uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) TS_CResult_RoutingFeesDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14580,11 +14575,10 @@ uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError } uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14635,11 +14629,10 @@ uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_ok"))) TS } uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_err"))) TS_CResult_NodeAliasDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14690,11 +14683,10 @@ uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_ok"))) TS_ } uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS_CResult_NodeInfoDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14746,11 +14738,10 @@ uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err"))) TS_CResult_NetworkGraphDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14842,11 +14833,10 @@ uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD } uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14897,11 +14887,10 @@ uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe } uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -14951,11 +14940,10 @@ uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode } uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -15297,6 +15285,54 @@ uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone"))) TS_CRe return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_ok"))) TS_CResult_PublicKeyNoneZ_ok(int8_tArray o) { + LDKPublicKey o_ref; + CHECK(o->arr_len == 33); + memcpy(o_ref.compressed_form, o->elems, 33); FREE(o); + LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ"); + *ret_conv = CResult_PublicKeyNoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_err"))) TS_CResult_PublicKeyNoneZ_err() { + LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ"); + *ret_conv = CResult_PublicKeyNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_PublicKeyNoneZ_is_ok"))) TS_CResult_PublicKeyNoneZ_is_ok(uint64_t o) { + LDKCResult_PublicKeyNoneZ* o_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_PublicKeyNoneZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_PublicKeyNoneZ_free"))) TS_CResult_PublicKeyNoneZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_PublicKeyNoneZ _res_conv = *(LDKCResult_PublicKeyNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_PublicKeyNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_PublicKeyNoneZ_clone_ptr(LDKCResult_PublicKeyNoneZ *NONNULL_PTR arg) { + LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ"); + *ret_conv = CResult_PublicKeyNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_clone_ptr"))) TS_CResult_PublicKeyNoneZ_clone_ptr(uint64_t arg) { + LDKCResult_PublicKeyNoneZ* arg_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PublicKeyNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_clone"))) TS_CResult_PublicKeyNoneZ_clone(uint64_t orig) { + LDKCResult_PublicKeyNoneZ* orig_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(orig); + LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ"); + *ret_conv = CResult_PublicKeyNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + uint64_t __attribute__((export_name("TS_COption_ScalarZ_some"))) TS_COption_ScalarZ_some(uint64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -15386,11 +15422,10 @@ uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_ok"))) TS_CRes } uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CResult_SignDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -15595,11 +15630,10 @@ uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok") } uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -16409,11 +16443,10 @@ uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecod } uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -16464,11 +16497,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ } uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -16519,11 +16551,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_ok") } uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -16574,11 +16605,10 @@ uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_o } uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -16672,11 +16702,10 @@ uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManager } uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -16709,11 +16738,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_ok")) } uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err"))) TS_CResult_ChannelConfigDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -16764,11 +16792,10 @@ uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_ } uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -16868,11 +16895,10 @@ uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_ok")) } uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err"))) TS_CResult_COption_TypeZDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -16976,11 +17002,10 @@ uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_ok")) } uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_err"))) TS_CResult_InFlightHtlcsDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -17585,11 +17610,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError } uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -17686,11 +17710,10 @@ uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro } uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -17741,11 +17764,10 @@ uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) T } uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -18197,11 +18219,10 @@ uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor } uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -18303,6 +18324,109 @@ void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CV CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); } +uint64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_some"))) TS_COption_CustomOnionMessageContentsZ_some(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCustomOnionMessageContents o_conv = *(LDKCustomOnionMessageContents*)(o_ptr); + if (o_conv.free == LDKCustomOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageContents_JCalls_cloned(&o_conv); + } + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_none"))) TS_COption_CustomOnionMessageContentsZ_none() { + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_free"))) TS_COption_CustomOnionMessageContentsZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_CustomOnionMessageContentsZ_free(_res_conv); +} + +static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) { + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_clone_ptr"))) TS_COption_CustomOnionMessageContentsZ_clone_ptr(uint64_t arg) { + LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg); + int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_clone"))) TS_COption_CustomOnionMessageContentsZ_clone(uint64_t orig) { + LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig); + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr); + o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o)); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(uint64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + uint64_t __attribute__((export_name("TS_COption_NetAddressZ_some"))) TS_COption_NetAddressZ_some(uint64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -18623,11 +18747,10 @@ uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_ok"))) T } uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -18758,11 +18881,10 @@ uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok")) } uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -18813,11 +18935,10 @@ uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr } uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -18868,11 +18989,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ } uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -18923,11 +19043,10 @@ uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok")) } uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -18978,11 +19097,10 @@ uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro } uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19033,11 +19151,10 @@ uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok } uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19088,11 +19205,10 @@ uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok") } uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19143,11 +19259,10 @@ uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok")) } uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19198,11 +19313,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_err"))) TS_CResult_ChannelReadyDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19253,11 +19367,10 @@ uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CRes } uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19308,11 +19421,10 @@ uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19363,11 +19475,10 @@ uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19418,11 +19529,10 @@ uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_ } uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19473,11 +19583,10 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok") } uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19528,11 +19637,10 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr } uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19583,11 +19691,10 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS } uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) TS_CResult_UpdateFeeDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19638,11 +19745,10 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_o } uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19693,11 +19799,10 @@ uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok")) } uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19748,11 +19853,10 @@ uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_err"))) TS_CResult_OnionMessageDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ"); *ret_conv = CResult_OnionMessageDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19803,11 +19907,10 @@ uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CRes } uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CResult_PingDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19858,11 +19961,10 @@ uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CRes } uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CResult_PongDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19913,11 +20015,10 @@ uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco } uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -19968,11 +20069,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ } uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20023,11 +20123,10 @@ uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro } uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20078,11 +20177,10 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok")) } uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20133,11 +20231,10 @@ uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) } uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err"))) TS_CResult_ErrorMessageDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20188,11 +20285,10 @@ uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_ok") } uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_err"))) TS_CResult_WarningMessageDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ"); *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20243,11 +20339,10 @@ uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE } uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20298,11 +20393,10 @@ uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok } uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20353,11 +20447,10 @@ uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError } uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20408,11 +20501,10 @@ uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr } uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20463,11 +20555,10 @@ uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_o } uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20518,11 +20609,10 @@ uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_o } uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20573,11 +20663,10 @@ uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro } uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_err(uint64_t e) { - LDKDecodeError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -20911,6 +21000,13 @@ uint64_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager" return ret_ref; } +jboolean __attribute__((export_name("TS_ClosureReason_eq"))) TS_ClosureReason_eq(uint64_t a, uint64_t b) { + LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); + LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); + jboolean ret_conv = ClosureReason_eq(a_conv, b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureReason_write(uint64_t obj) { LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj); LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); @@ -20989,6 +21085,13 @@ uint64_t __attribute__((export_name("TS_HTLCDestination_failed_payment"))) TS_H return ret_ref; } +jboolean __attribute__((export_name("TS_HTLCDestination_eq"))) TS_HTLCDestination_eq(uint64_t a, uint64_t b) { + LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a); + LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b); + jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_HTLCDestination_write"))) TS_HTLCDestination_write(uint64_t obj) { LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj); LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv); @@ -21808,9 +21911,9 @@ uint64_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_API return ret_ref; } -uint64_t __attribute__((export_name("TS_APIError_monitor_update_failed"))) TS_APIError_monitor_update_failed() { +uint64_t __attribute__((export_name("TS_APIError_monitor_update_in_progress"))) TS_APIError_monitor_update_in_progress() { LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_monitor_update_failed(); + *ret_copy = APIError_monitor_update_in_progress(); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -21827,6 +21930,13 @@ uint64_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script") return ret_ref; } +jboolean __attribute__((export_name("TS_APIError_eq"))) TS_APIError_eq(uint64_t a, uint64_t b) { + LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a); + LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b); + jboolean ret_conv = APIError_eq(a_conv, b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_BigSize_free"))) TS_BigSize_free(uint64_t this_obj) { LDKBigSize this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -21900,6 +22010,21 @@ uint64_t __attribute__((export_name("TS_Hostname_clone"))) TS_Hostname_clone(ui return ret_ref; } +jboolean __attribute__((export_name("TS_Hostname_eq"))) TS_Hostname_eq(uint64_t a, uint64_t b) { + LDKHostname a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHostname b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Hostname_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_t __attribute__((export_name("TS_Hostname_len"))) TS_Hostname_len(uint64_t this_arg) { LDKHostname this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -22812,6 +22937,21 @@ uint64_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfi return ret_ref; } +jboolean __attribute__((export_name("TS_ChannelConfig_eq"))) TS_ChannelConfig_eq(uint64_t a, uint64_t b) { + LDKChannelConfig a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelConfig b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv); + return ret_conv; +} + uint64_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() { LDKChannelConfig ret_var = ChannelConfig_default(); uint64_t ret_ref = 0; @@ -23088,6 +23228,21 @@ uint64_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone( return ret_ref; } +jboolean __attribute__((export_name("TS_BestBlock_eq"))) TS_BestBlock_eq(uint64_t a, uint64_t b) { + LDKBestBlock a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBestBlock b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv); + return ret_conv; +} + uint64_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock_from_genesis(uint32_t network) { LDKNetwork network_conv = LDKNetwork_from_js(network); LDKBestBlock ret_var = BestBlock_from_genesis(network_conv); @@ -23172,19 +23327,31 @@ void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_free(uint64_t t Confirm_free(this_ptr_conv); } -uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_clone"))) TS_ChannelMonitorUpdateErr_clone(uint64_t orig) { - LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)untag_ptr(orig); - uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_clone(orig_conv)); +uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_clone"))) TS_ChannelMonitorUpdateStatus_clone(uint64_t orig) { + LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig); + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_clone(orig_conv)); return ret_conv; } -uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_temporary_failure"))) TS_ChannelMonitorUpdateErr_temporary_failure() { - uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_temporary_failure()); +uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_completed"))) TS_ChannelMonitorUpdateStatus_completed() { + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_completed()); return ret_conv; } -uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_permanent_failure"))) TS_ChannelMonitorUpdateErr_permanent_failure() { - uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_permanent_failure()); +uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_in_progress"))) TS_ChannelMonitorUpdateStatus_in_progress() { + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_in_progress()); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_permanent_failure"))) TS_ChannelMonitorUpdateStatus_permanent_failure() { + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_permanent_failure()); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_ChannelMonitorUpdateStatus_eq"))) TS_ChannelMonitorUpdateStatus_eq(uint64_t a, uint64_t b) { + LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a); + LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b); + jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv); return ret_conv; } @@ -23339,6 +23506,21 @@ uint64_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutpu return ret_ref; } +jboolean __attribute__((export_name("TS_WatchedOutput_eq"))) TS_WatchedOutput_eq(uint64_t a, uint64_t b) { + LDKWatchedOutput a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKWatchedOutput b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv); + return ret_conv; +} + int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_hash(uint64_t o) { LDKWatchedOutput o_conv; o_conv.inner = untag_ptr(o); @@ -23804,14 +23986,14 @@ uint64_t __attribute__((export_name("TS_MonitorEvent_commitment_tx_confirmed")) return ret_ref; } -uint64_t __attribute__((export_name("TS_MonitorEvent_update_completed"))) TS_MonitorEvent_update_completed(uint64_t funding_txo, int64_t monitor_update_id) { +uint64_t __attribute__((export_name("TS_MonitorEvent_completed"))) TS_MonitorEvent_completed(uint64_t funding_txo, int64_t monitor_update_id) { LDKOutPoint funding_txo_conv; funding_txo_conv.inner = untag_ptr(funding_txo); funding_txo_conv.is_owned = ptr_is_owned(funding_txo); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); + *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -23828,6 +24010,13 @@ uint64_t __attribute__((export_name("TS_MonitorEvent_update_failed"))) TS_Monit return ret_ref; } +jboolean __attribute__((export_name("TS_MonitorEvent_eq"))) TS_MonitorEvent_eq(uint64_t a, uint64_t b) { + LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a); + LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b); + jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint64_t obj) { LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj); LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); @@ -23885,6 +24074,21 @@ uint64_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clon return ret_ref; } +jboolean __attribute__((export_name("TS_HTLCUpdate_eq"))) TS_HTLCUpdate_eq(uint64_t a, uint64_t b) { + LDKHTLCUpdate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHTLCUpdate b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_write(uint64_t obj) { LDKHTLCUpdate obj_conv; obj_conv.inner = untag_ptr(obj); @@ -24871,6 +25075,21 @@ uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone")) return ret_ref; } +jboolean __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_eq"))) TS_DelayedPaymentOutputDescriptor_eq(uint64_t a, uint64_t b) { + LDKDelayedPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKDelayedPaymentOutputDescriptor b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write"))) TS_DelayedPaymentOutputDescriptor_write(uint64_t obj) { LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); @@ -25045,6 +25264,21 @@ uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone"))) return ret_ref; } +jboolean __attribute__((export_name("TS_StaticPaymentOutputDescriptor_eq"))) TS_StaticPaymentOutputDescriptor_eq(uint64_t a, uint64_t b) { + LDKStaticPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKStaticPaymentOutputDescriptor b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write"))) TS_StaticPaymentOutputDescriptor_write(uint64_t obj) { LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); @@ -25137,6 +25371,13 @@ uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_paymen return ret_ref; } +jboolean __attribute__((export_name("TS_SpendableOutputDescriptor_eq"))) TS_SpendableOutputDescriptor_eq(uint64_t a, uint64_t b) { + LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a); + LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b); + jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) TS_SpendableOutputDescriptor_write(uint64_t obj) { LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj); LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); @@ -27794,6 +28035,30 @@ uint64_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler return tag_ptr(ret_ret, true); } +uint64_t __attribute__((export_name("TS_provided_node_features"))) TS_provided_node_features() { + LDKNodeFeatures ret_var = provided_node_features(); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_provided_channel_features"))) TS_provided_channel_features() { + LDKChannelFeatures ret_var = provided_channel_features(); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_provided_init_features"))) TS_provided_init_features() { + LDKInitFeatures ret_var = provided_init_features(); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + int8_tArray __attribute__((export_name("TS_CounterpartyForwardingInfo_write"))) TS_CounterpartyForwardingInfo_write(uint64_t obj) { LDKCounterpartyForwardingInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -28206,44 +28471,92 @@ uint64_t __attribute__((export_name("TS_create_from_hash"))) TS_create_from_has return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_obj) { - LDKDecodeError this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DecodeError_free(this_obj_conv); +void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + DecodeError_free(this_ptr_conv); } static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { - LDKDecodeError ret_var = DecodeError_clone(arg); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint64_t arg) { - LDKDecodeError arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = DecodeError_clone_ptr(&arg_conv); + LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg); + int64_t ret_conv = DecodeError_clone_ptr(arg_conv); return ret_conv; } uint64_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_clone(uint64_t orig) { - LDKDecodeError orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKDecodeError ret_var = DecodeError_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_DecodeError_unknown_version"))) TS_DecodeError_unknown_version() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_unknown_version(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_DecodeError_unknown_required_feature"))) TS_DecodeError_unknown_required_feature() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_unknown_required_feature(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_DecodeError_invalid_value"))) TS_DecodeError_invalid_value() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_invalid_value(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_DecodeError_short_read"))) TS_DecodeError_short_read() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_short_read(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_DecodeError_bad_length_descriptor"))) TS_DecodeError_bad_length_descriptor() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_bad_length_descriptor(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_DecodeError_io"))) TS_DecodeError_io(uint32_t a) { + LDKIOError a_conv = LDKIOError_from_js(a); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_io(a_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_DecodeError_unsupported_compression"))) TS_DecodeError_unsupported_compression() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_unsupported_compression(); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +jboolean __attribute__((export_name("TS_DecodeError_eq"))) TS_DecodeError_eq(uint64_t a, uint64_t b) { + LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a); + LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b); + jboolean ret_conv = DecodeError_eq(a_conv, b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_Init_free"))) TS_Init_free(uint64_t this_obj) { LDKInit this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -28350,6 +28663,21 @@ uint64_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint64_t o return ret_ref; } +jboolean __attribute__((export_name("TS_Init_eq"))) TS_Init_eq(uint64_t a, uint64_t b) { + LDKInit a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInit b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Init_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ErrorMessage_free"))) TS_ErrorMessage_free(uint64_t this_obj) { LDKErrorMessage this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -28445,6 +28773,21 @@ uint64_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_ return ret_ref; } +jboolean __attribute__((export_name("TS_ErrorMessage_eq"))) TS_ErrorMessage_eq(uint64_t a, uint64_t b) { + LDKErrorMessage a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKErrorMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_WarningMessage_free"))) TS_WarningMessage_free(uint64_t this_obj) { LDKWarningMessage this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -28540,6 +28883,21 @@ uint64_t __attribute__((export_name("TS_WarningMessage_clone"))) TS_WarningMess return ret_ref; } +jboolean __attribute__((export_name("TS_WarningMessage_eq"))) TS_WarningMessage_eq(uint64_t a, uint64_t b) { + LDKWarningMessage a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKWarningMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_Ping_free"))) TS_Ping_free(uint64_t this_obj) { LDKPing this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -28624,6 +28982,21 @@ uint64_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint64_t o return ret_ref; } +jboolean __attribute__((export_name("TS_Ping_eq"))) TS_Ping_eq(uint64_t a, uint64_t b) { + LDKPing a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPing b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Ping_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_Pong_free"))) TS_Pong_free(uint64_t this_obj) { LDKPong this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -28689,6 +29062,21 @@ uint64_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint64_t o return ret_ref; } +jboolean __attribute__((export_name("TS_Pong_eq"))) TS_Pong_eq(uint64_t a, uint64_t b) { + LDKPong a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPong b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Pong_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_OpenChannel_free"))) TS_OpenChannel_free(uint64_t this_obj) { LDKOpenChannel this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -29128,6 +29516,21 @@ uint64_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_cl return ret_ref; } +jboolean __attribute__((export_name("TS_OpenChannel_eq"))) TS_OpenChannel_eq(uint64_t a, uint64_t b) { + LDKOpenChannel a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOpenChannel b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_AcceptChannel_free"))) TS_AcceptChannel_free(uint64_t this_obj) { LDKAcceptChannel this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -29487,6 +29890,21 @@ uint64_t __attribute__((export_name("TS_AcceptChannel_clone"))) TS_AcceptChanne return ret_ref; } +jboolean __attribute__((export_name("TS_AcceptChannel_eq"))) TS_AcceptChannel_eq(uint64_t a, uint64_t b) { + LDKAcceptChannel a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKAcceptChannel b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = AcceptChannel_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_FundingCreated_free"))) TS_FundingCreated_free(uint64_t this_obj) { LDKFundingCreated this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -29630,6 +30048,21 @@ uint64_t __attribute__((export_name("TS_FundingCreated_clone"))) TS_FundingCrea return ret_ref; } +jboolean __attribute__((export_name("TS_FundingCreated_eq"))) TS_FundingCreated_eq(uint64_t a, uint64_t b) { + LDKFundingCreated a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKFundingCreated b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_FundingSigned_free"))) TS_FundingSigned_free(uint64_t this_obj) { LDKFundingSigned this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -29728,6 +30161,21 @@ uint64_t __attribute__((export_name("TS_FundingSigned_clone"))) TS_FundingSigne return ret_ref; } +jboolean __attribute__((export_name("TS_FundingSigned_eq"))) TS_FundingSigned_eq(uint64_t a, uint64_t b) { + LDKFundingSigned a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKFundingSigned b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ChannelReady_free"))) TS_ChannelReady_free(uint64_t this_obj) { LDKChannelReady this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -29855,6 +30303,21 @@ uint64_t __attribute__((export_name("TS_ChannelReady_clone"))) TS_ChannelReady_ return ret_ref; } +jboolean __attribute__((export_name("TS_ChannelReady_eq"))) TS_ChannelReady_eq(uint64_t a, uint64_t b) { + LDKChannelReady a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelReady b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_Shutdown_free"))) TS_Shutdown_free(uint64_t this_obj) { LDKShutdown this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -29956,6 +30419,21 @@ uint64_t __attribute__((export_name("TS_Shutdown_clone"))) TS_Shutdown_clone(ui return ret_ref; } +jboolean __attribute__((export_name("TS_Shutdown_eq"))) TS_Shutdown_eq(uint64_t a, uint64_t b) { + LDKShutdown a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKShutdown b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Shutdown_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ClosingSignedFeeRange_free"))) TS_ClosingSignedFeeRange_free(uint64_t this_obj) { LDKClosingSignedFeeRange this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30040,6 +30518,21 @@ uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone"))) TS_Clos return ret_ref; } +jboolean __attribute__((export_name("TS_ClosingSignedFeeRange_eq"))) TS_ClosingSignedFeeRange_eq(uint64_t a, uint64_t b) { + LDKClosingSignedFeeRange a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKClosingSignedFeeRange b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ClosingSignedFeeRange_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ClosingSigned_free"))) TS_ClosingSigned_free(uint64_t this_obj) { LDKClosingSigned this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30189,6 +30682,21 @@ uint64_t __attribute__((export_name("TS_ClosingSigned_clone"))) TS_ClosingSigne return ret_ref; } +jboolean __attribute__((export_name("TS_ClosingSigned_eq"))) TS_ClosingSigned_eq(uint64_t a, uint64_t b) { + LDKClosingSigned a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKClosingSigned b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ClosingSigned_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_UpdateAddHTLC_free"))) TS_UpdateAddHTLC_free(uint64_t this_obj) { LDKUpdateAddHTLC this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30330,6 +30838,21 @@ uint64_t __attribute__((export_name("TS_UpdateAddHTLC_clone"))) TS_UpdateAddHTL return ret_ref; } +jboolean __attribute__((export_name("TS_UpdateAddHTLC_eq"))) TS_UpdateAddHTLC_eq(uint64_t a, uint64_t b) { + LDKUpdateAddHTLC a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUpdateAddHTLC b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UpdateAddHTLC_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_OnionMessage_free"))) TS_OnionMessage_free(uint64_t this_obj) { LDKOnionMessage this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30391,6 +30914,21 @@ uint64_t __attribute__((export_name("TS_OnionMessage_clone"))) TS_OnionMessage_ return ret_ref; } +jboolean __attribute__((export_name("TS_OnionMessage_eq"))) TS_OnionMessage_eq(uint64_t a, uint64_t b) { + LDKOnionMessage a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOnionMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OnionMessage_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_UpdateFulfillHTLC_free"))) TS_UpdateFulfillHTLC_free(uint64_t this_obj) { LDKUpdateFulfillHTLC this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30508,6 +31046,21 @@ uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone"))) TS_UpdateFu return ret_ref; } +jboolean __attribute__((export_name("TS_UpdateFulfillHTLC_eq"))) TS_UpdateFulfillHTLC_eq(uint64_t a, uint64_t b) { + LDKUpdateFulfillHTLC a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUpdateFulfillHTLC b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UpdateFulfillHTLC_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_UpdateFailHTLC_free"))) TS_UpdateFailHTLC_free(uint64_t this_obj) { LDKUpdateFailHTLC this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30588,6 +31141,21 @@ uint64_t __attribute__((export_name("TS_UpdateFailHTLC_clone"))) TS_UpdateFailH return ret_ref; } +jboolean __attribute__((export_name("TS_UpdateFailHTLC_eq"))) TS_UpdateFailHTLC_eq(uint64_t a, uint64_t b) { + LDKUpdateFailHTLC a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUpdateFailHTLC b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UpdateFailHTLC_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_UpdateFailMalformedHTLC_free"))) TS_UpdateFailMalformedHTLC_free(uint64_t this_obj) { LDKUpdateFailMalformedHTLC this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30687,6 +31255,21 @@ uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone"))) TS_Up return ret_ref; } +jboolean __attribute__((export_name("TS_UpdateFailMalformedHTLC_eq"))) TS_UpdateFailMalformedHTLC_eq(uint64_t a, uint64_t b) { + LDKUpdateFailMalformedHTLC a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUpdateFailMalformedHTLC b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UpdateFailMalformedHTLC_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_CommitmentSigned_free"))) TS_CommitmentSigned_free(uint64_t this_obj) { LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30844,6 +31427,21 @@ uint64_t __attribute__((export_name("TS_CommitmentSigned_clone"))) TS_Commitmen return ret_ref; } +jboolean __attribute__((export_name("TS_CommitmentSigned_eq"))) TS_CommitmentSigned_eq(uint64_t a, uint64_t b) { + LDKCommitmentSigned a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKCommitmentSigned b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = CommitmentSigned_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_RevokeAndACK_free"))) TS_RevokeAndACK_free(uint64_t this_obj) { LDKRevokeAndACK this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30968,6 +31566,21 @@ uint64_t __attribute__((export_name("TS_RevokeAndACK_clone"))) TS_RevokeAndACK_ return ret_ref; } +jboolean __attribute__((export_name("TS_RevokeAndACK_eq"))) TS_RevokeAndACK_eq(uint64_t a, uint64_t b) { + LDKRevokeAndACK a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRevokeAndACK b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RevokeAndACK_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_UpdateFee_free"))) TS_UpdateFee_free(uint64_t this_obj) { LDKUpdateFee this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -31059,6 +31672,21 @@ uint64_t __attribute__((export_name("TS_UpdateFee_clone"))) TS_UpdateFee_clone( return ret_ref; } +jboolean __attribute__((export_name("TS_UpdateFee_eq"))) TS_UpdateFee_eq(uint64_t a, uint64_t b) { + LDKUpdateFee a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUpdateFee b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UpdateFee_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_DataLossProtect_free"))) TS_DataLossProtect_free(uint64_t this_obj) { LDKDataLossProtect this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -31157,6 +31785,21 @@ uint64_t __attribute__((export_name("TS_DataLossProtect_clone"))) TS_DataLossPr return ret_ref; } +jboolean __attribute__((export_name("TS_DataLossProtect_eq"))) TS_DataLossProtect_eq(uint64_t a, uint64_t b) { + LDKDataLossProtect a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKDataLossProtect b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = DataLossProtect_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ChannelReestablish_free"))) TS_ChannelReestablish_free(uint64_t this_obj) { LDKChannelReestablish this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -31256,6 +31899,21 @@ uint64_t __attribute__((export_name("TS_ChannelReestablish_clone"))) TS_Channel return ret_ref; } +jboolean __attribute__((export_name("TS_ChannelReestablish_eq"))) TS_ChannelReestablish_eq(uint64_t a, uint64_t b) { + LDKChannelReestablish a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelReestablish b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelReestablish_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_AnnouncementSignatures_free"))) TS_AnnouncementSignatures_free(uint64_t this_obj) { LDKAnnouncementSignatures this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -31399,6 +32057,21 @@ uint64_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_Ann return ret_ref; } +jboolean __attribute__((export_name("TS_AnnouncementSignatures_eq"))) TS_AnnouncementSignatures_eq(uint64_t a, uint64_t b) { + LDKAnnouncementSignatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKAnnouncementSignatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = AnnouncementSignatures_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -31480,6 +32153,13 @@ uint64_t __attribute__((export_name("TS_NetAddress_hostname"))) TS_NetAddress_h return ret_ref; } +jboolean __attribute__((export_name("TS_NetAddress_eq"))) TS_NetAddress_eq(uint64_t a, uint64_t b) { + LDKNetAddress* a_conv = (LDKNetAddress*)untag_ptr(a); + LDKNetAddress* b_conv = (LDKNetAddress*)untag_ptr(b); + jboolean ret_conv = NetAddress_eq(a_conv, b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_write(uint64_t obj) { LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj); LDKCVec_u8Z ret_var = NetAddress_write(obj_conv); @@ -31698,6 +32378,21 @@ uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone"))) TS_U return ret_ref; } +jboolean __attribute__((export_name("TS_UnsignedNodeAnnouncement_eq"))) TS_UnsignedNodeAnnouncement_eq(uint64_t a, uint64_t b) { + LDKUnsignedNodeAnnouncement a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUnsignedNodeAnnouncement b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UnsignedNodeAnnouncement_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_NodeAnnouncement_free"))) TS_NodeAnnouncement_free(uint64_t this_obj) { LDKNodeAnnouncement this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -31802,6 +32497,21 @@ uint64_t __attribute__((export_name("TS_NodeAnnouncement_clone"))) TS_NodeAnnou return ret_ref; } +jboolean __attribute__((export_name("TS_NodeAnnouncement_eq"))) TS_NodeAnnouncement_eq(uint64_t a, uint64_t b) { + LDKNodeAnnouncement a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeAnnouncement b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeAnnouncement_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_UnsignedChannelAnnouncement_free"))) TS_UnsignedChannelAnnouncement_free(uint64_t this_obj) { LDKUnsignedChannelAnnouncement this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -32001,6 +32711,21 @@ uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone"))) T return ret_ref; } +jboolean __attribute__((export_name("TS_UnsignedChannelAnnouncement_eq"))) TS_UnsignedChannelAnnouncement_eq(uint64_t a, uint64_t b) { + LDKUnsignedChannelAnnouncement a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUnsignedChannelAnnouncement b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UnsignedChannelAnnouncement_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ChannelAnnouncement_free"))) TS_ChannelAnnouncement_free(uint64_t this_obj) { LDKChannelAnnouncement this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -32183,6 +32908,21 @@ uint64_t __attribute__((export_name("TS_ChannelAnnouncement_clone"))) TS_Channe return ret_ref; } +jboolean __attribute__((export_name("TS_ChannelAnnouncement_eq"))) TS_ChannelAnnouncement_eq(uint64_t a, uint64_t b) { + LDKChannelAnnouncement a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelAnnouncement b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelAnnouncement_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_UnsignedChannelUpdate_free"))) TS_UnsignedChannelUpdate_free(uint64_t this_obj) { LDKUnsignedChannelUpdate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -32437,6 +33177,21 @@ uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_Unsi return ret_ref; } +jboolean __attribute__((export_name("TS_UnsignedChannelUpdate_eq"))) TS_UnsignedChannelUpdate_eq(uint64_t a, uint64_t b) { + LDKUnsignedChannelUpdate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUnsignedChannelUpdate b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UnsignedChannelUpdate_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ChannelUpdate_free"))) TS_ChannelUpdate_free(uint64_t this_obj) { LDKChannelUpdate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -32541,6 +33296,21 @@ uint64_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdat return ret_ref; } +jboolean __attribute__((export_name("TS_ChannelUpdate_eq"))) TS_ChannelUpdate_eq(uint64_t a, uint64_t b) { + LDKChannelUpdate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelUpdate b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelUpdate_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_QueryChannelRange_free"))) TS_QueryChannelRange_free(uint64_t this_obj) { LDKQueryChannelRange this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -32651,6 +33421,21 @@ uint64_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryCha return ret_ref; } +jboolean __attribute__((export_name("TS_QueryChannelRange_eq"))) TS_QueryChannelRange_eq(uint64_t a, uint64_t b) { + LDKQueryChannelRange a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKQueryChannelRange b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = QueryChannelRange_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ReplyChannelRange_free"))) TS_ReplyChannelRange_free(uint64_t this_obj) { LDKReplyChannelRange this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -32832,6 +33617,21 @@ uint64_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyCha return ret_ref; } +jboolean __attribute__((export_name("TS_ReplyChannelRange_eq"))) TS_ReplyChannelRange_eq(uint64_t a, uint64_t b) { + LDKReplyChannelRange a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKReplyChannelRange b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ReplyChannelRange_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_QueryShortChannelIds_free"))) TS_QueryShortChannelIds_free(uint64_t this_obj) { LDKQueryShortChannelIds this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -32956,6 +33756,21 @@ uint64_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_Query return ret_ref; } +jboolean __attribute__((export_name("TS_QueryShortChannelIds_eq"))) TS_QueryShortChannelIds_eq(uint64_t a, uint64_t b) { + LDKQueryShortChannelIds a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKQueryShortChannelIds b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = QueryShortChannelIds_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_free"))) TS_ReplyShortChannelIdsEnd_free(uint64_t this_obj) { LDKReplyShortChannelIdsEnd this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -33047,6 +33862,21 @@ uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone"))) TS_Re return ret_ref; } +jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_eq"))) TS_ReplyShortChannelIdsEnd_eq(uint64_t a, uint64_t b) { + LDKReplyShortChannelIdsEnd a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKReplyShortChannelIdsEnd b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ReplyShortChannelIdsEnd_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_GossipTimestampFilter_free"))) TS_GossipTimestampFilter_free(uint64_t this_obj) { LDKGossipTimestampFilter this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -33157,6 +33987,21 @@ uint64_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_Goss return ret_ref; } +jboolean __attribute__((export_name("TS_GossipTimestampFilter_eq"))) TS_GossipTimestampFilter_eq(uint64_t a, uint64_t b) { + LDKGossipTimestampFilter a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKGossipTimestampFilter b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = GossipTimestampFilter_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(uint64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -33713,6 +34558,21 @@ uint64_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_Commitmen return ret_ref; } +jboolean __attribute__((export_name("TS_CommitmentUpdate_eq"))) TS_CommitmentUpdate_eq(uint64_t a, uint64_t b) { + LDKCommitmentUpdate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKCommitmentUpdate b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = CommitmentUpdate_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMessageHandler_free(uint64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -34601,6 +35461,17 @@ uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_OnionMessageH return tag_ptr(ret_ret, true); } +uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomOnionMessageHandler"))) TS_IgnoringMessageHandler_as_CustomOnionMessageHandler(uint64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCustomOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_CustomOnionMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -34883,7 +35754,7 @@ void __attribute__((export_name("TS_PeerManager_free"))) TS_PeerManager_free(ui PeerManager_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new(uint64_t message_handler, int8_tArray our_node_secret, int64_t current_time, int8_tArray ephemeral_random_data, uint64_t logger, uint64_t custom_message_handler) { +uint64_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new(uint64_t message_handler, int8_tArray our_node_secret, int32_t current_time, int8_tArray ephemeral_random_data, uint64_t logger, uint64_t custom_message_handler) { LDKMessageHandler message_handler_conv; message_handler_conv.inner = untag_ptr(message_handler); message_handler_conv.is_owned = ptr_is_owned(message_handler); @@ -35438,6 +36309,21 @@ uint64_t __attribute__((export_name("TS_TxCreationKeys_new"))) TS_TxCreationKey return ret_ref; } +jboolean __attribute__((export_name("TS_TxCreationKeys_eq"))) TS_TxCreationKeys_eq(uint64_t a, uint64_t b) { + LDKTxCreationKeys a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKTxCreationKeys b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = TxCreationKeys_eq(&a_conv, &b_conv); + return ret_conv; +} + static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); uint64_t ret_ref = 0; @@ -35667,6 +36553,21 @@ uint64_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelP return ret_ref; } +jboolean __attribute__((export_name("TS_ChannelPublicKeys_eq"))) TS_ChannelPublicKeys_eq(uint64_t a, uint64_t b) { + LDKChannelPublicKeys a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelPublicKeys b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelPublicKeys_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_ChannelPublicKeys_write(uint64_t obj) { LDKChannelPublicKeys obj_conv; obj_conv.inner = untag_ptr(obj); @@ -35902,6 +36803,21 @@ uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTL return ret_ref; } +jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_eq"))) TS_HTLCOutputInCommitment_eq(uint64_t a, uint64_t b) { + LDKHTLCOutputInCommitment a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHTLCOutputInCommitment b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = HTLCOutputInCommitment_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_HTLCOutputInCommitment_write(uint64_t obj) { LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = untag_ptr(obj); @@ -36822,6 +37738,21 @@ int64_t __attribute__((export_name("TS_ClosingTransaction_hash"))) TS_ClosingTr return ret_conv; } +jboolean __attribute__((export_name("TS_ClosingTransaction_eq"))) TS_ClosingTransaction_eq(uint64_t a, uint64_t b) { + LDKClosingTransaction a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKClosingTransaction b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ClosingTransaction_eq(&a_conv, &b_conv); + return ret_conv; +} + uint64_t __attribute__((export_name("TS_ClosingTransaction_new"))) TS_ClosingTransaction_new(int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, uint64_t funding_outpoint) { LDKCVec_u8Z to_holder_script_ref; to_holder_script_ref.datalen = to_holder_script->arr_len; @@ -37462,22 +38393,6 @@ void __attribute__((export_name("TS_ChannelTypeFeatures_free"))) TS_ChannelType ChannelTypeFeatures_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_InitFeatures_known_channel_features"))) TS_InitFeatures_known_channel_features() { - LDKInitFeatures ret_var = InitFeatures_known_channel_features(); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_NodeFeatures_known_channel_features"))) TS_NodeFeatures_known_channel_features() { - LDKNodeFeatures ret_var = NodeFeatures_known_channel_features(); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - uint64_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_empty() { LDKInitFeatures ret_var = InitFeatures_empty(); uint64_t ret_ref = 0; @@ -37486,14 +38401,6 @@ uint64_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_ return ret_ref; } -uint64_t __attribute__((export_name("TS_InitFeatures_known"))) TS_InitFeatures_known() { - LDKInitFeatures ret_var = InitFeatures_known(); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - jboolean __attribute__((export_name("TS_InitFeatures_requires_unknown_bits"))) TS_InitFeatures_requires_unknown_bits(uint64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -37512,14 +38419,6 @@ uint64_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_ return ret_ref; } -uint64_t __attribute__((export_name("TS_NodeFeatures_known"))) TS_NodeFeatures_known() { - LDKNodeFeatures ret_var = NodeFeatures_known(); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) TS_NodeFeatures_requires_unknown_bits(uint64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -37538,14 +38437,6 @@ uint64_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFea return ret_ref; } -uint64_t __attribute__((export_name("TS_ChannelFeatures_known"))) TS_ChannelFeatures_known() { - LDKChannelFeatures ret_var = ChannelFeatures_known(); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits"))) TS_ChannelFeatures_requires_unknown_bits(uint64_t this_arg) { LDKChannelFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -37564,14 +38455,6 @@ uint64_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFea return ret_ref; } -uint64_t __attribute__((export_name("TS_InvoiceFeatures_known"))) TS_InvoiceFeatures_known() { - LDKInvoiceFeatures ret_var = InvoiceFeatures_known(); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits"))) TS_InvoiceFeatures_requires_unknown_bits(uint64_t this_arg) { LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -37590,14 +38473,6 @@ uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_Channe return ret_ref; } -uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_known"))) TS_ChannelTypeFeatures_known() { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known(); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_unknown_bits"))) TS_ChannelTypeFeatures_requires_unknown_bits(uint64_t this_arg) { LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -39043,6 +39918,21 @@ uint64_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScr return ret_ref; } +jboolean __attribute__((export_name("TS_ShutdownScript_eq"))) TS_ShutdownScript_eq(uint64_t a, uint64_t b) { + LDKShutdownScript a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKShutdownScript b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_InvalidShutdownScript_free"))) TS_InvalidShutdownScript_free(uint64_t this_obj) { LDKInvalidShutdownScript this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -39423,6 +40313,13 @@ uint64_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_Netwo return ret_ref; } +jboolean __attribute__((export_name("TS_NetworkUpdate_eq"))) TS_NetworkUpdate_eq(uint64_t a, uint64_t b) { + LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a); + LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b); + jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUpdate_write(uint64_t obj) { LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj); LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); @@ -39739,6 +40636,21 @@ uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone"))) TS_ChannelU return ret_ref; } +jboolean __attribute__((export_name("TS_ChannelUpdateInfo_eq"))) TS_ChannelUpdateInfo_eq(uint64_t a, uint64_t b) { + LDKChannelUpdateInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelUpdateInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_ChannelUpdateInfo_write"))) TS_ChannelUpdateInfo_write(uint64_t obj) { LDKChannelUpdateInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -39987,6 +40899,21 @@ uint64_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_cl return ret_ref; } +jboolean __attribute__((export_name("TS_ChannelInfo_eq"))) TS_ChannelInfo_eq(uint64_t a, uint64_t b) { + LDKChannelInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + uint64_t __attribute__((export_name("TS_ChannelInfo_get_directional_info"))) TS_ChannelInfo_get_directional_info(uint64_t this_arg, int8_t channel_flags) { LDKChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -40563,6 +41490,21 @@ uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeA return ret_ref; } +jboolean __attribute__((export_name("TS_NodeAnnouncementInfo_eq"))) TS_NodeAnnouncementInfo_eq(uint64_t a, uint64_t b) { + LDKNodeAnnouncementInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeAnnouncementInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_NodeAnnouncementInfo_write(uint64_t obj) { LDKNodeAnnouncementInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -40658,6 +41600,21 @@ uint64_t __attribute__((export_name("TS_NodeAlias_clone"))) TS_NodeAlias_clone( return ret_ref; } +jboolean __attribute__((export_name("TS_NodeAlias_eq"))) TS_NodeAlias_eq(uint64_t a, uint64_t b) { + LDKNodeAlias a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeAlias b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_NodeAlias_write"))) TS_NodeAlias_write(uint64_t obj) { LDKNodeAlias obj_conv; obj_conv.inner = untag_ptr(obj); @@ -40843,6 +41800,21 @@ uint64_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(ui return ret_ref; } +jboolean __attribute__((export_name("TS_NodeInfo_eq"))) TS_NodeInfo_eq(uint64_t a, uint64_t b) { + LDKNodeInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write(uint64_t obj) { LDKNodeInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -41065,25 +42037,25 @@ void __attribute__((export_name("TS_NetworkGraph_channel_failed"))) TS_NetworkG NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent); } -void __attribute__((export_name("TS_NetworkGraph_node_failed"))) TS_NetworkGraph_node_failed(uint64_t this_arg, int8_tArray _node_id, jboolean is_permanent) { +void __attribute__((export_name("TS_NetworkGraph_node_failed_permanent"))) TS_NetworkGraph_node_failed_permanent(uint64_t this_arg, int8_tArray node_id) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPublicKey _node_id_ref; - CHECK(_node_id->arr_len == 33); - memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); FREE(_node_id); - NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent); + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref); } -void __attribute__((export_name("TS_NetworkGraph_remove_stale_channels_with_time"))) TS_NetworkGraph_remove_stale_channels_with_time(uint64_t this_arg, int64_t current_time_unix) { +void __attribute__((export_name("TS_NetworkGraph_remove_stale_channels_and_tracking_with_time"))) TS_NetworkGraph_remove_stale_channels_and_tracking_with_time(uint64_t this_arg, int64_t current_time_unix) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix); + NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix); } uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_NetworkGraph_update_channel(uint64_t this_arg, uint64_t msg) { @@ -43134,6 +44106,63 @@ void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidit ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(uint64_t this_ptr) { + LDKProbabilisticScoringParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(uint64_t this_ptr, int64_t val) { + LDKProbabilisticScoringParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); +} + +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(uint64_t this_ptr) { + LDKProbabilisticScoringParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(uint64_t this_ptr, int64_t val) { + LDKProbabilisticScoringParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +} + +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_historical_no_updates_half_life"))) TS_ProbabilisticScoringParameters_get_historical_no_updates_half_life(uint64_t this_ptr) { + LDKProbabilisticScoringParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ProbabilisticScoringParameters_get_historical_no_updates_half_life(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_historical_no_updates_half_life"))) TS_ProbabilisticScoringParameters_set_historical_no_updates_half_life(uint64_t this_ptr, int64_t val) { + LDKProbabilisticScoringParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); +} + int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat(uint64_t this_ptr) { LDKProbabilisticScoringParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -43587,6 +44616,13 @@ uint64_t __attribute__((export_name("TS_SendError_invalid_first_hop"))) TS_Send return ret_ref; } +uint64_t __attribute__((export_name("TS_SendError_invalid_message"))) TS_SendError_invalid_message() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_invalid_message(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint64_t __attribute__((export_name("TS_SendError_buffer_full"))) TS_SendError_buffer_full() { LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); *ret_copy = SendError_buffer_full(); @@ -43594,7 +44630,23 @@ uint64_t __attribute__((export_name("TS_SendError_buffer_full"))) TS_SendError_ return ret_ref; } -uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenger_new(uint64_t keys_manager, uint64_t logger) { +jboolean __attribute__((export_name("TS_SendError_eq"))) TS_SendError_eq(uint64_t a, uint64_t b) { + LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); + LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); + jboolean ret_conv = SendError_eq(a_conv, b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CustomOnionMessageHandler_free"))) TS_CustomOnionMessageHandler_free(uint64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomOnionMessageHandler_free(this_ptr_conv); +} + +uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenger_new(uint64_t keys_manager, uint64_t logger, uint64_t custom_handler) { void* keys_manager_ptr = untag_ptr(keys_manager); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -43609,14 +44661,21 @@ uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenge // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKOnionMessenger ret_var = OnionMessenger_new(keys_manager_conv, logger_conv); + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKOnionMessenger ret_var = OnionMessenger_new(keys_manager_conv, logger_conv, custom_handler_conv); uint64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -uint64_t __attribute__((export_name("TS_OnionMessenger_send_onion_message"))) TS_OnionMessenger_send_onion_message(uint64_t this_arg, ptrArray intermediate_nodes, uint64_t destination, uint64_t reply_path) { +uint64_t __attribute__((export_name("TS_OnionMessenger_send_custom_onion_message"))) TS_OnionMessenger_send_custom_onion_message(uint64_t this_arg, ptrArray intermediate_nodes, uint64_t destination, uint64_t msg, uint64_t reply_path) { LDKOnionMessenger this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -43641,13 +44700,20 @@ uint64_t __attribute__((export_name("TS_OnionMessenger_send_onion_message"))) T CHECK_ACCESS(destination_ptr); LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); // WARNING: we may need a move here but no clone is available for LDKDestination + void* msg_ptr = untag_ptr(msg); + CHECK_ACCESS(msg_ptr); + LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr); + if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv); + } LDKBlindedRoute reply_path_conv; reply_path_conv.inner = untag_ptr(reply_path); reply_path_conv.is_owned = ptr_is_owned(reply_path); CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); reply_path_conv.is_owned = false; LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, reply_path_conv); + *ret_conv = OnionMessenger_send_custom_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, msg_conv, reply_path_conv); return tag_ptr(ret_conv, true); } @@ -43673,6 +44739,37 @@ uint64_t __attribute__((export_name("TS_OnionMessenger_as_OnionMessageProvider" return tag_ptr(ret_ret, true); } +static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) { + LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents"); + *ret_ret = CustomOnionMessageContents_clone(arg); + return tag_ptr(ret_ret, true); +} +int64_t __attribute__((export_name("TS_CustomOnionMessageContents_clone_ptr"))) TS_CustomOnionMessageContents_clone_ptr(uint64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKCustomOnionMessageContents* arg_conv = (LDKCustomOnionMessageContents*)arg_ptr; + int64_t ret_conv = CustomOnionMessageContents_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CustomOnionMessageContents_clone"))) TS_CustomOnionMessageContents_clone(uint64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKCustomOnionMessageContents* orig_conv = (LDKCustomOnionMessageContents*)orig_ptr; + LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents"); + *ret_ret = CustomOnionMessageContents_clone(orig_conv); + return tag_ptr(ret_ret, true); +} + +void __attribute__((export_name("TS_CustomOnionMessageContents_free"))) TS_CustomOnionMessageContents_free(uint64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKCustomOnionMessageContents this_ptr_conv = *(LDKCustomOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomOnionMessageContents_free(this_ptr_conv); +} + void __attribute__((export_name("TS_RapidGossipSync_free"))) TS_RapidGossipSync_free(uint64_t this_obj) { LDKRapidGossipSync this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -43749,11 +44846,10 @@ uint64_t __attribute__((export_name("TS_GraphSyncError_clone"))) TS_GraphSyncEr } uint64_t __attribute__((export_name("TS_GraphSyncError_decode_error"))) TS_GraphSyncError_decode_error(uint64_t a) { - LDKDecodeError a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = DecodeError_clone(&a_conv); + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr); + a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a)); LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); *ret_copy = GraphSyncError_decode_error(a_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); @@ -43935,6 +45031,13 @@ uint64_t __attribute__((export_name("TS_ParseError_skip"))) TS_ParseError_skip( return ret_ref; } +jboolean __attribute__((export_name("TS_ParseError_eq"))) TS_ParseError_eq(uint64_t a, uint64_t b) { + LDKParseError* a_conv = (LDKParseError*)untag_ptr(a); + LDKParseError* b_conv = (LDKParseError*)untag_ptr(b); + jboolean ret_conv = ParseError_eq(a_conv, b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_ParseOrSemanticError_free"))) TS_ParseOrSemanticError_free(uint64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -43983,6 +45086,13 @@ uint64_t __attribute__((export_name("TS_ParseOrSemanticError_semantic_error"))) return ret_ref; } +jboolean __attribute__((export_name("TS_ParseOrSemanticError_eq"))) TS_ParseOrSemanticError_eq(uint64_t a, uint64_t b) { + LDKParseOrSemanticError* a_conv = (LDKParseOrSemanticError*)untag_ptr(a); + LDKParseOrSemanticError* b_conv = (LDKParseOrSemanticError*)untag_ptr(b); + jboolean ret_conv = ParseOrSemanticError_eq(a_conv, b_conv); + return ret_conv; +} + void __attribute__((export_name("TS_Invoice_free"))) TS_Invoice_free(uint64_t this_obj) { LDKInvoice this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -46029,7 +47139,7 @@ uint64_t __attribute__((export_name("TS_InFlightHtlcs_read"))) TS_InFlightHtlcs return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(uint64_t channelmanager, uint64_t keys_manager, uint32_t network, uint64_t amt_msat, uint64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) { +uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(uint64_t channelmanager, uint64_t keys_manager, uint64_t logger, uint32_t network, uint64_t amt_msat, uint64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = untag_ptr(channelmanager); channelmanager_conv.is_owned = ptr_is_owned(channelmanager); @@ -46042,6 +47152,13 @@ uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_with // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKKeysInterface_JCalls_cloned(&keys_manager_conv); } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } LDKCurrency network_conv = LDKCurrency_from_js(network); void* amt_msat_ptr = untag_ptr(amt_msat); CHECK_ACCESS(amt_msat_ptr); @@ -46053,11 +47170,11 @@ uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_with CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); description_hash_conv = Sha256_clone(&description_hash_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs); + *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_and_duration_since_epoch(uint64_t channelmanager, uint64_t keys_manager, uint32_t network, uint64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) { +uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_and_duration_since_epoch(uint64_t channelmanager, uint64_t keys_manager, uint64_t logger, uint32_t network, uint64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = untag_ptr(channelmanager); channelmanager_conv.is_owned = ptr_is_owned(channelmanager); @@ -46070,6 +47187,13 @@ uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_and_ // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKKeysInterface_JCalls_cloned(&keys_manager_conv); } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } LDKCurrency network_conv = LDKCurrency_from_js(network); void* amt_msat_ptr = untag_ptr(amt_msat); CHECK_ACCESS(amt_msat_ptr); @@ -46077,7 +47201,7 @@ uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_and_ amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); LDKStr description_conv = str_ref_to_owned_c(description); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs); return tag_ptr(ret_conv, true); }