X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjni%2Fbindings.c.body;h=06beaea6b325ba5b0f18a1a832150b7ff39ebf4c;hb=874b548986e3315d08b2de24c36bcdbbad0ae98b;hp=5dd76f4414f55b2eb2728b4215062653c137631a;hpb=79bfb8673ac55758278dfca0d942d6c842420513;p=ldk-java diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index 5dd76f44..06beaea6 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -131,7 +131,7 @@ static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) { } JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1lib_1version_1string(JNIEnv *env, jclass _c) { - return str_ref_to_java(env, "v0.0.98.4", strlen("v0.0.98.4")); + return str_ref_to_java(env, "v0.0.99.1", strlen("v0.0.99.1")); } JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) { return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version())); @@ -452,52 +452,46 @@ static inline jclass LDKIOError_to_java(JNIEnv *env, LDKIOError val) { static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass clz) { switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) { - case 0: return LDKLevel_Off; - case 1: return LDKLevel_Error; - case 2: return LDKLevel_Warn; - case 3: return LDKLevel_Info; - case 4: return LDKLevel_Debug; - case 5: return LDKLevel_Trace; + case 0: return LDKLevel_Trace; + case 1: return LDKLevel_Debug; + case 2: return LDKLevel_Info; + case 3: return LDKLevel_Warn; + case 4: return LDKLevel_Error; } abort(); } static jclass Level_class = NULL; -static jfieldID Level_LDKLevel_Off = NULL; -static jfieldID Level_LDKLevel_Error = NULL; -static jfieldID Level_LDKLevel_Warn = NULL; -static jfieldID Level_LDKLevel_Info = NULL; -static jfieldID Level_LDKLevel_Debug = NULL; static jfieldID Level_LDKLevel_Trace = NULL; +static jfieldID Level_LDKLevel_Debug = NULL; +static jfieldID Level_LDKLevel_Info = NULL; +static jfieldID Level_LDKLevel_Warn = NULL; +static jfieldID Level_LDKLevel_Error = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_Level_init (JNIEnv *env, jclass clz) { Level_class = (*env)->NewGlobalRef(env, clz); CHECK(Level_class != NULL); - Level_LDKLevel_Off = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Off", "Lorg/ldk/enums/Level;"); - CHECK(Level_LDKLevel_Off != NULL); - Level_LDKLevel_Error = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Error", "Lorg/ldk/enums/Level;"); - CHECK(Level_LDKLevel_Error != NULL); - Level_LDKLevel_Warn = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Warn", "Lorg/ldk/enums/Level;"); - CHECK(Level_LDKLevel_Warn != NULL); - Level_LDKLevel_Info = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Info", "Lorg/ldk/enums/Level;"); - CHECK(Level_LDKLevel_Info != NULL); - Level_LDKLevel_Debug = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Debug", "Lorg/ldk/enums/Level;"); - CHECK(Level_LDKLevel_Debug != NULL); Level_LDKLevel_Trace = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Trace", "Lorg/ldk/enums/Level;"); CHECK(Level_LDKLevel_Trace != NULL); + Level_LDKLevel_Debug = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Debug", "Lorg/ldk/enums/Level;"); + CHECK(Level_LDKLevel_Debug != NULL); + Level_LDKLevel_Info = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Info", "Lorg/ldk/enums/Level;"); + CHECK(Level_LDKLevel_Info != NULL); + Level_LDKLevel_Warn = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Warn", "Lorg/ldk/enums/Level;"); + CHECK(Level_LDKLevel_Warn != NULL); + Level_LDKLevel_Error = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Error", "Lorg/ldk/enums/Level;"); + CHECK(Level_LDKLevel_Error != NULL); } static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) { switch (val) { - case LDKLevel_Off: - return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Off); - case LDKLevel_Error: - return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Error); - case LDKLevel_Warn: - return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Warn); - case LDKLevel_Info: - return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Info); - case LDKLevel_Debug: - return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Debug); case LDKLevel_Trace: return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Trace); + case LDKLevel_Debug: + return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Debug); + case LDKLevel_Info: + return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Info); + case LDKLevel_Warn: + return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Warn); + case LDKLevel_Error: + return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Error); default: abort(); } } @@ -1466,6 +1460,8 @@ static jclass LDKErrorAction_DisconnectPeer_class = NULL; static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL; static jclass LDKErrorAction_IgnoreError_class = NULL; static jmethodID LDKErrorAction_IgnoreError_meth = NULL; +static jclass LDKErrorAction_IgnoreAndLog_class = NULL; +static jmethodID LDKErrorAction_IgnoreAndLog_meth = NULL; static jclass LDKErrorAction_SendErrorMessage_class = NULL; static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv *env, jclass clz) { @@ -1479,6 +1475,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIE CHECK(LDKErrorAction_IgnoreError_class != NULL); LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "", "()V"); CHECK(LDKErrorAction_IgnoreError_meth != NULL); + LDKErrorAction_IgnoreAndLog_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreAndLog;")); + CHECK(LDKErrorAction_IgnoreAndLog_class != NULL); + LDKErrorAction_IgnoreAndLog_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreAndLog_class, "", "(Lorg/ldk/enums/Level;)V"); + CHECK(LDKErrorAction_IgnoreAndLog_meth != NULL); LDKErrorAction_SendErrorMessage_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$SendErrorMessage;")); CHECK(LDKErrorAction_SendErrorMessage_class != NULL); @@ -1498,6 +1499,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1 case LDKErrorAction_IgnoreError: { return (*env)->NewObject(env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth); } + case LDKErrorAction_IgnoreAndLog: { + jclass ignore_and_log_conv = LDKLevel_to_java(env, obj->ignore_and_log); + return (*env)->NewObject(env, LDKErrorAction_IgnoreAndLog_class, LDKErrorAction_IgnoreAndLog_meth, ignore_and_log_conv); + } case LDKErrorAction_SendErrorMessage: { LDKErrorMessage msg_var = obj->send_error_message.msg; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -1580,6 +1585,8 @@ static jclass LDKMessageSendEvent_BroadcastNodeAnnouncement_class = NULL; static jmethodID LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = NULL; static jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL; static jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL; +static jclass LDKMessageSendEvent_SendChannelUpdate_class = NULL; +static jmethodID LDKMessageSendEvent_SendChannelUpdate_meth = NULL; static jclass LDKMessageSendEvent_HandleError_class = NULL; static jmethodID LDKMessageSendEvent_HandleError_meth = NULL; static jclass LDKMessageSendEvent_PaymentFailureNetworkUpdate_class = NULL; @@ -1661,6 +1668,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL); LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "", "(J)V"); CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL); + LDKMessageSendEvent_SendChannelUpdate_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelUpdate;")); + CHECK(LDKMessageSendEvent_SendChannelUpdate_class != NULL); + LDKMessageSendEvent_SendChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelUpdate_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendChannelUpdate_meth != NULL); LDKMessageSendEvent_HandleError_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$HandleError;")); CHECK(LDKMessageSendEvent_HandleError_class != NULL); @@ -1814,6 +1826,15 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref); } + case LDKMessageSendEvent_SendChannelUpdate: { + int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_update.node_id.compressed_form); + LDKChannelUpdate msg_var = obj->send_channel_update.msg; + CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uint64_t msg_ref = (uint64_t)msg_var.inner & ~1; + return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref); + } case LDKMessageSendEvent_HandleError: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->handle_error.node_id.compressed_form); @@ -2139,7 +2160,7 @@ LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, ui int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_per_commitment_point in LDKBaseSign from rust threw an exception."); } LDKPublicKey ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 33); @@ -2163,7 +2184,7 @@ LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_a int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to release_commitment_secret in LDKBaseSign from rust threw an exception."); } LDKThirtyTwoBytes ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); @@ -2187,7 +2208,7 @@ LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to channel_keys_id in LDKBaseSign from rust threw an exception."); } LDKThirtyTwoBytes ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); @@ -2219,7 +2240,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to sign_counterparty_commitment in LDKBaseSign from rust threw an exception."); } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); @@ -2250,7 +2271,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to sign_holder_commitment_and_htlcs in LDKBaseSign from rust threw an exception."); } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); @@ -2279,7 +2300,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input, amount, per_commitment_key_arr); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to sign_justice_revoked_output in LDKBaseSign from rust threw an exception."); } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); @@ -2316,7 +2337,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to sign_justice_revoked_htlc in LDKBaseSign from rust threw an exception."); } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); @@ -2353,7 +2374,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to sign_counterparty_htlc_transaction in LDKBaseSign from rust threw an exception."); } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); @@ -2380,7 +2401,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_closing_transaction_meth, closing_tx_arr); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to sign_closing_transaction in LDKBaseSign from rust threw an exception."); } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); @@ -2411,7 +2432,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_channel_announcement_meth, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to sign_channel_announcement in LDKBaseSign from rust threw an exception."); } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); @@ -2442,7 +2463,7 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction (*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to ready_channel in LDKBaseSign from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -2691,7 +2712,7 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) { int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to write in LDKSign from rust threw an exception."); } LDKCVec_u8Z ret_ref; ret_ref.datalen = (*env)->GetArrayLength(env, ret); @@ -2939,6 +2960,34 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1B jclass err_conv = LDKIOError_to_java(env, (*val->contents.err)); return err_conv; } +static jclass LDKCOption_u16Z_Some_class = NULL; +static jmethodID LDKCOption_u16Z_Some_meth = NULL; +static jclass LDKCOption_u16Z_None_class = NULL; +static jmethodID LDKCOption_u16Z_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u16Z_init (JNIEnv *env, jclass clz) { + LDKCOption_u16Z_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u16Z$Some;")); + CHECK(LDKCOption_u16Z_Some_class != NULL); + LDKCOption_u16Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_Some_class, "", "(S)V"); + CHECK(LDKCOption_u16Z_Some_meth != NULL); + LDKCOption_u16Z_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u16Z$None;")); + CHECK(LDKCOption_u16Z_None_class != NULL); + LDKCOption_u16Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_None_class, "", "()V"); + CHECK(LDKCOption_u16Z_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u16Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_u16Z *obj = (LDKCOption_u16Z*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_u16Z_Some: { + return (*env)->NewObject(env, LDKCOption_u16Z_Some_class, LDKCOption_u16Z_Some_meth, obj->some); + } + case LDKCOption_u16Z_None: { + return (*env)->NewObject(env, LDKCOption_u16Z_None_class, LDKCOption_u16Z_None_meth); + } + default: abort(); + } +} static jclass LDKAPIError_APIMisuseError_class = NULL; static jmethodID LDKAPIError_APIMisuseError_meth = NULL; static jclass LDKAPIError_FeeRateTooHigh_class = NULL; @@ -3361,7 +3410,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception."); } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); @@ -3398,7 +3447,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception."); } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); @@ -3421,7 +3470,7 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to release_pending_monitor_events in LDKWatch from rust threw an exception."); } LDKCVec_MonitorEventZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); @@ -3562,7 +3611,7 @@ void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, L (*env)->CallVoidMethod(env, obj, j_calls->broadcast_transaction_meth, tx_arr); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to broadcast_transaction in LDKBroadcasterInterface from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -3648,7 +3697,7 @@ LDKSecretKey get_node_secret_LDKKeysInterface_jcall(const void* this_arg) { int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_node_secret_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_node_secret in LDKKeysInterface from rust threw an exception."); } LDKSecretKey ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); @@ -3672,7 +3721,7 @@ LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_destination_script in LDKKeysInterface from rust threw an exception."); } LDKCVec_u8Z ret_ref; ret_ref.datalen = (*env)->GetArrayLength(env, ret); @@ -3697,7 +3746,7 @@ LDKPublicKey get_shutdown_pubkey_LDKKeysInterface_jcall(const void* this_arg) { int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_shutdown_pubkey_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_shutdown_pubkey in LDKKeysInterface from rust threw an exception."); } LDKPublicKey ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 33); @@ -3721,7 +3770,7 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb LDKSign* ret = (LDKSign*)(*env)->CallLongMethod(env, obj, j_calls->get_channel_signer_meth, inbound, channel_value_satoshis); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_channel_signer in LDKKeysInterface from rust threw an exception."); } LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1); ret_conv = Sign_clone(ret); @@ -3744,7 +3793,7 @@ LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* thi int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_secure_random_bytes in LDKKeysInterface from rust threw an exception."); } LDKThirtyTwoBytes ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); @@ -3771,7 +3820,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* LDKCResult_SignDecodeErrorZ* ret = (LDKCResult_SignDecodeErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to read_chan_signer in LDKKeysInterface from rust threw an exception."); } LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1)); @@ -3798,7 +3847,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v LDKCResult_RecoverableSignatureNoneZ* ret = (LDKCResult_RecoverableSignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, invoice_preimage_arr); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to sign_invoice in LDKKeysInterface from rust threw an exception."); } LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1)); @@ -3949,7 +3998,7 @@ uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, int32_t ret = (*env)->CallIntMethod(env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_est_sat_per_1000_weight in LDKFeeEstimator from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -4029,7 +4078,7 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) { (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_conv); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -6068,7 +6117,7 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_and_clear_pending_msg_events in LDKMessageSendEventsProvider from rust threw an exception."); } LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); @@ -6172,7 +6221,7 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, event_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -6250,7 +6299,7 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve (*env)->CallVoidMethod(env, obj, j_calls->process_pending_events_meth, (uint64_t)ret); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to process_pending_events in LDKEventsProvider from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -6332,7 +6381,7 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception."); } LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1)); @@ -6420,7 +6469,7 @@ void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uin (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -6442,7 +6491,7 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -6548,7 +6597,7 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -6570,7 +6619,7 @@ void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_ (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -6592,7 +6641,7 @@ void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -6612,7 +6661,7 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception."); } LDKCVec_TxidZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); @@ -6766,7 +6815,7 @@ void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32 (*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to register_tx in LDKFilter from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -6793,7 +6842,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void LDKCOption_C2Tuple_usizeTransactionZZ* ret = (LDKCOption_C2Tuple_usizeTransactionZZ*)(*env)->CallLongMethod(env, obj, j_calls->register_output_meth, output_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to register_output in LDKFilter from rust threw an exception."); } LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1); ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1)); @@ -6910,7 +6959,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, id_ref, data_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception."); } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); @@ -6956,7 +7005,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception."); } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); @@ -7100,7 +7149,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD (*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_open_channel in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7137,7 +7186,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, (*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_accept_channel in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7167,7 +7216,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_funding_created in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7197,7 +7246,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_funding_signed in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7227,7 +7276,7 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_funding_locked in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7265,7 +7314,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub (*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_shutdown in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7295,7 +7344,7 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, (*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_closing_signed in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7325,7 +7374,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, (*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_update_add_htlc in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7355,7 +7404,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_update_fulfill_htlc in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7385,7 +7434,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_update_fail_htlc in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7415,7 +7464,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_update_fail_malformed_htlc in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7445,7 +7494,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar (*env)->CallVoidMethod(env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_commitment_signed in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7475,7 +7524,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, (*env)->CallVoidMethod(env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_revoke_and_ack in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7505,7 +7554,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_update_fee in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7535,7 +7584,7 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t (*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_announcement_signatures in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7557,7 +7606,7 @@ void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to peer_disconnected in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7587,7 +7636,7 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to peer_connected in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7617,7 +7666,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_channel_reestablish in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7647,7 +7696,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_channel_update in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -7677,7 +7726,7 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic (*env)->CallVoidMethod(env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_error in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -8054,7 +8103,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception."); } LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); @@ -8085,7 +8134,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception."); } LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); @@ -8116,7 +8165,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception."); } LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); @@ -8140,7 +8189,7 @@ void handle_htlc_fail_channel_update_LDKRoutingMessageHandler_jcall(const void* (*env)->CallVoidMethod(env, obj, j_calls->handle_htlc_fail_channel_update_meth, ret_update); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_htlc_fail_channel_update in LDKRoutingMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -8160,7 +8209,7 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_next_channel_announcements in LDKRoutingMessageHandler from rust threw an exception."); } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); @@ -8197,7 +8246,7 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to get_next_node_announcements in LDKRoutingMessageHandler from rust threw an exception."); } LDKCVec_NodeAnnouncementZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); @@ -8244,7 +8293,7 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK (*env)->CallVoidMethod(env, obj, j_calls->sync_routing_table_meth, their_node_id_arr, init_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to sync_routing_table in LDKRoutingMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -8273,7 +8322,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_reply_channel_range in LDKRoutingMessageHandler from rust threw an exception."); } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); @@ -8305,7 +8354,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_reply_short_channel_ids_end in LDKRoutingMessageHandler from rust threw an exception."); } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); @@ -8337,7 +8386,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_query_channel_range in LDKRoutingMessageHandler from rust threw an exception."); } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); @@ -8369,7 +8418,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_query_short_channel_ids in LDKRoutingMessageHandler from rust threw an exception."); } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); @@ -8622,7 +8671,7 @@ uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, b int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to send_data in LDKSocketDescriptor from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -8643,7 +8692,7 @@ void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) { (*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to disconnect_socket in LDKSocketDescriptor from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -8665,7 +8714,7 @@ bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescripto jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, (uint64_t)other_arg_clone); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to eq in LDKSocketDescriptor from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -8686,7 +8735,7 @@ uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->hash_meth); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to hash in LDKSocketDescriptor from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -8796,7 +8845,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi LDKCResult_NoneErrorZ* ret = (LDKCResult_NoneErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + (*env)->FatalError(env, "A call to persist_manager in LDKChannelManagerPersister from rust threw an exception."); } LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1)); @@ -10419,6 +10468,35 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockH CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_some(o); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none(JNIEnv *env, jclass clz) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + COption_u16Z_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) { LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_ok(); @@ -13252,9 +13330,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass cl LDKu8slice msg_ref; msg_ref.datalen = (*env)->GetArrayLength(env, msg); msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); - LDKSecretKey sk_ref; + unsigned char sk_arr[32]; CHECK((*env)->GetArrayLength(env, sk) == 32); - (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_ref.bytes); + (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr); + unsigned char (*sk_ref)[32] = &sk_arr; LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); *ret_conv = sign(msg_ref, sk_ref); (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); @@ -13574,19 +13653,34 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *en ChannelConfig_free(this_obj_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - int32_t ret_val = ChannelConfig_get_fee_proportional_millionths(&this_ptr_conv); + int32_t ret_val = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - ChannelConfig_set_fee_proportional_millionths(&this_ptr_conv, val); + ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + int32_t ret_val = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); } JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13634,8 +13728,8 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1up ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) { - LDKChannelConfig ret_var = ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) { + LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg); CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. uint64_t ret_ref = (uint64_t)ret_var.inner; @@ -13773,7 +13867,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1opti UserConfig_set_channel_options(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jboolean ret_val = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg) { LDKChannelHandshakeConfig own_channel_config_arg_conv; own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); @@ -13786,7 +13895,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); - LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv); + LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg); CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. uint64_t ret_ref = (uint64_t)ret_var.inner; @@ -13821,6 +13930,70 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv return ret_ref; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBestBlock this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + BestBlock_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBestBlock orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + LDKBestBlock ret_var = BestBlock_clone(&orig_conv); + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uint64_t ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) { + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + LDKBestBlock ret_var = BestBlock_from_genesis(network_conv); + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uint64_t ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) { + LDKThirtyTwoBytes block_hash_ref; + CHECK((*env)->GetArrayLength(env, block_hash) == 32); + (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data); + LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uint64_t ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBestBlock this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data); + return ret_arr; +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBestBlock this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + int32_t ret_val = BestBlock_height(&this_arg_conv); + return ret_val; +} + JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAccessError* orig_conv = (LDKAccessError*)(orig & ~1); jclass ret_conv = LDKAccessError_to_java(env, AccessError_clone(orig_conv)); @@ -14572,6 +14745,20 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1r return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uint64_t ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; LDKPersist this_ptr_conv = *(LDKPersist*)(((uint64_t)this_ptr) & ~1); @@ -15566,30 +15753,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBestBlock this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelCounterparty this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - BestBlock_free(this_obj_conv); + ChannelCounterparty_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBestBlock orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - LDKBestBlock ret_var = BestBlock_clone(&orig_conv); - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - uint64_t ret_ref = (uint64_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) { - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - LDKBestBlock ret_var = BestBlock_from_genesis(network_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. uint64_t ret_ref = (uint64_t)ret_var.inner; @@ -15599,11 +15793,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JN return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) { - LDKThirtyTwoBytes block_hash_ref; - CHECK((*env)->GetArrayLength(env, block_hash) == 32); - (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data); - LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKInitFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + val_conv = InitFeatures_clone(&val_conv); + ChannelCounterparty_set_features(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + int64_t ret_val = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelCounterparty orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. uint64_t ret_ref = (uint64_t)ret_var.inner; @@ -15613,23 +15833,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data); - return ret_arr; -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - int32_t ret_val = BestBlock_height(&this_arg_conv); - return ret_val; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKChannelDetails this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); @@ -15656,6 +15859,31 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uint64_t ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKChannelCounterparty val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + val_conv = ChannelCounterparty_clone(&val_conv); + ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -15699,63 +15927,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1ch ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelDetails_get_remote_network_id(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); + return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelDetails_set_remote_network_id(&this_ptr_conv, val_ref); + ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKInitFeatures ret_var = ChannelDetails_get_counterparty_features(&this_ptr_conv); - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - uint64_t ret_ref = (uint64_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); + uint64_t ret_ref = (uint64_t)ret_copy; return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKInitFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - val_conv = InitFeatures_clone(&val_conv); - ChannelDetails_set_counterparty_features(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); - return ret_val; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -15803,6 +16005,42 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1); + ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(((uint64_t)val) & ~1); + ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); +} + JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -15863,6 +16101,32 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1publi ChannelDetails_set_is_public(&this_ptr_conv, val); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t short_channel_id_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int64_t user_id_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKChannelCounterparty counterparty_arg_conv; + counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); + counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); + counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); + LDKOutPoint funding_txo_arg_conv; + funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1)); + funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); + funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); + LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1); + LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1); + LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1); + LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uint64_t ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelDetails orig_conv; orig_conv.inner = (void*)(orig & (~1)); @@ -16235,6 +16499,20 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persist ChannelManager_await_persistable_update(&this_arg_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uint64_t ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1));