From feef5033999da539aa3b6a74953282fa523ce9f6 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 27 Aug 2020 16:38:43 -0400 Subject: [PATCH] Pull out type mapping --- genbindings.py | 70 ++++++++---- src/main/java/org/ldk/impl/bindings.java | 104 +++++++++--------- src/main/jni/bindings.c | 132 +++++++++++------------ 3 files changed, 166 insertions(+), 140 deletions(-) diff --git a/genbindings.py b/genbindings.py index 350ccb63..d9944e7e 100755 --- a/genbindings.py +++ b/genbindings.py @@ -10,65 +10,91 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java, open(sys.arg var_is_arr_regex = re.compile("\(\*([A-za-z_]*)\)\[([0-9]*)\]") var_ty_regex = re.compile("([A-za-z_0-9]*)(.*)") - def map_type(fn_arg, print_void, ret_arr_len, is_free): + def java_c_types(fn_arg, ret_arr_len): fn_arg = fn_arg.strip() if fn_arg.startswith("MUST_USE_RES "): fn_arg = fn_arg[13:] if fn_arg.startswith("const "): fn_arg = fn_arg[6:] - c_ty = None - is_ptr_to_obj = None + is_ptr = False if fn_arg.startswith("void"): - if print_void: - out_java.write("void") - c_ty = "void" - else: - return (None, None, None) + java_ty = "void" + c_ty = "void" fn_arg = fn_arg.strip("void ") elif fn_arg.startswith("bool"): - out_java.write("boolean") + java_ty = "boolean" c_ty = "jboolean" fn_arg = fn_arg.strip("bool ") elif fn_arg.startswith("uint8_t"): - out_java.write("byte") + java_ty = "byte" c_ty = "jbyte" fn_arg = fn_arg.strip("uint8_t ") elif fn_arg.startswith("uint32_t"): - out_java.write("int") + java_ty = "int" c_ty = "jint" fn_arg = fn_arg.strip("uint32_t ") elif fn_arg.startswith("uint64_t"): - out_java.write("long") + java_ty = "long" c_ty = "jlong" fn_arg = fn_arg.strip("uint64_t ") else: ma = var_ty_regex.match(fn_arg) - out_java.write("long") - out_c.write("jlong") + java_ty = "long" + c_ty = "jlong" + fn_arg = ma.group(2) + is_ptr = True + + var_is_arr = var_is_arr_regex.match(fn_arg) + if var_is_arr is not None or ret_arr_len is not None: + java_ty = java_ty + "[]" + c_ty = c_ty + "Array" + return (java_ty, c_ty, is_ptr) + + def map_type(fn_arg, print_void, ret_arr_len, is_free): + fn_arg = fn_arg.strip() + if fn_arg.startswith("MUST_USE_RES "): + fn_arg = fn_arg[13:] + if fn_arg.startswith("const "): + fn_arg = fn_arg[6:] + + (java_ty, c_ty, is_ptr) = java_c_types(fn_arg, ret_arr_len) + is_ptr_to_obj = None + if fn_arg.startswith("void"): + if not print_void: + return (None, None, None) + fn_arg = fn_arg.strip("void ") + elif not is_ptr: + split = fn_arg.split(" ", 2) + if len(split) > 1: + fn_arg = split[1] + else: + fn_arg = "" + else: + ma = var_ty_regex.match(fn_arg) is_ptr_to_obj = ma.group(1) fn_arg = ma.group(2) - if c_ty is not None: - out_c.write(c_ty) + assert(c_ty is not None) + assert(java_ty is not None) + out_c.write(c_ty) + out_java.write(java_ty) var_is_arr = var_is_arr_regex.match(fn_arg) no_ptr = fn_arg.replace('*', '') if var_is_arr is not None or ret_arr_len is not None: - out_java.write("[] ") - out_c.write("Array ") if var_is_arr is not None: arr_name = var_is_arr.group(1) arr_len = var_is_arr.group(2) - out_java.write(arr_name) - out_c.write(arr_name) + out_java.write(" " + arr_name) + out_c.write(" " + arr_name) else: arr_name = "ret" arr_len = ret_arr_len - assert(c_ty == "jbyte") + assert(c_ty == "jbyteArray") return ("unsigned char " + arr_name + "_arr[" + arr_len + "];\n" + "(*_env)->GetByteArrayRegion (_env, """ + arr_name + ", 0, " + arr_len + ", " + arr_name + "_arr);\n" + "unsigned char (*""" + arr_name + "_ref)[" + arr_len + "] = &" + arr_name + "_arr;", - (c_ty + "Array " + arr_name + "_arr = (*_env)->NewByteArray(_env, " + arr_len + ");\n" + + (c_ty + " " + arr_name + "_arr = (*_env)->NewByteArray(_env, " + arr_len + ");\n" + "(*_env)->SetByteArrayRegion(_env, " + arr_name + "_arr, 0, " + arr_len + ", *", ");\nreturn ret_arr;"), arr_name + "_ref") diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 7e436821..9ce76a0d 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -337,7 +337,7 @@ public class bindings { /// bool ChannelHandshakeLimits_get_force_announced_channel_preference(const LDKChannelHandshakeLimits *this_ptr); public static native boolean ChannelHandshakeLimits_get_force_announced_channel_preference(long this_ptr); /// void ChannelHandshakeLimits_set_force_announced_channel_preference(LDKChannelHandshakeLimits *this_ptr, bool val); - public static native void ChannelHandshakeLimits_set_force_announced_channel_preference(long this_ptr, boolean va); + public static native void ChannelHandshakeLimits_set_force_announced_channel_preference(long this_ptr, boolean val); /// uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const LDKChannelHandshakeLimits *this_ptr); public static native long ChannelHandshakeLimits_get_their_to_self_delay(long this_ptr); /// void ChannelHandshakeLimits_set_their_to_self_delay(LDKChannelHandshakeLimits *this_ptr, uint16_t val); @@ -355,11 +355,11 @@ public class bindings { /// bool ChannelConfig_get_announced_channel(const LDKChannelConfig *this_ptr); public static native boolean ChannelConfig_get_announced_channel(long this_ptr); /// void ChannelConfig_set_announced_channel(LDKChannelConfig *this_ptr, bool val); - public static native void ChannelConfig_set_announced_channel(long this_ptr, boolean va); + public static native void ChannelConfig_set_announced_channel(long this_ptr, boolean val); /// bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const LDKChannelConfig *this_ptr); public static native boolean ChannelConfig_get_commit_upfront_shutdown_pubkey(long this_ptr); /// void ChannelConfig_set_commit_upfront_shutdown_pubkey(LDKChannelConfig *this_ptr, bool val); - public static native void ChannelConfig_set_commit_upfront_shutdown_pubkey(long this_ptr, boolean va); + public static native void ChannelConfig_set_commit_upfront_shutdown_pubkey(long this_ptr, boolean val); /// MUST_USE_RES LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg); public static native long ChannelConfig_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg); /// MUST_USE_RES LDKChannelConfig ChannelConfig_default(void); @@ -413,11 +413,11 @@ public class bindings { /// void BlockNotifier_register_listener(const LDKBlockNotifier *this_arg, LDKChainListener listener); public static native void BlockNotifier_register_listener(long this_arg, long listener); /// void BlockNotifier_block_connected(const LDKBlockNotifier *this_arg, LDKu8slice block, uint32_t height); - public static native void BlockNotifier_block_connected(long this_arg, long block, int heigh); + public static native void BlockNotifier_block_connected(long this_arg, long block, int height); /// MUST_USE_RES bool BlockNotifier_block_connected_checked(const LDKBlockNotifier *this_arg, const uint8_t (*header)[80], uint32_t height, LDKCVec_TransactionZ txn_matched, LDKusizeslice indexes_of_txn_matched); - public static native boolean BlockNotifier_block_connected_checked(long this_arg, byte[] header, int heigh, long txn_matched, long indexes_of_txn_matched); + public static native boolean BlockNotifier_block_connected_checked(long this_arg, byte[] header, int height, long txn_matched, long indexes_of_txn_matched); /// void BlockNotifier_block_disconnected(const LDKBlockNotifier *this_arg, const uint8_t (*header)[80], uint32_t disconnected_height); - public static native void BlockNotifier_block_disconnected(long this_arg, byte[] header, int disconnected_heigh); + public static native void BlockNotifier_block_disconnected(long this_arg, byte[] header, int disconnected_height); /// void ChainWatchInterfaceUtil_free(LDKChainWatchInterfaceUtil this_ptr); public static native void ChainWatchInterfaceUtil_free(long this_ptr); /// LDKChainWatchInterface ChainWatchInterfaceUtil_as_ChainWatchInterface(const LDKChainWatchInterfaceUtil *this_arg); @@ -429,7 +429,7 @@ public class bindings { /// void OutPoint_free(LDKOutPoint this_ptr); public static native void OutPoint_free(long this_ptr); /// const uint8_t (*OutPoint_get_txid(const LDKOutPoint *this_ptr))[32]; - public static native byte[] OutPoint_get_txid(long this_ptr); + public static native byte[] OutPoint_get_txid(long this_ptr); /// void OutPoint_set_txid(LDKOutPoint *this_ptr, LDKThirtyTwoBytes val); public static native void OutPoint_set_txid(long this_ptr, long val); /// uint16_t OutPoint_get_index(const LDKOutPoint *this_ptr); @@ -453,27 +453,27 @@ public class bindings { /// void InMemoryChannelKeys_free(LDKInMemoryChannelKeys this_ptr); public static native void InMemoryChannelKeys_free(long this_ptr); /// const uint8_t (*InMemoryChannelKeys_get_funding_key(const LDKInMemoryChannelKeys *this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_funding_key(long this_ptr); + public static native byte[] InMemoryChannelKeys_get_funding_key(long this_ptr); /// void InMemoryChannelKeys_set_funding_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); public static native void InMemoryChannelKeys_set_funding_key(long this_ptr, long val); /// const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const LDKInMemoryChannelKeys *this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_revocation_base_key(long this_ptr); + public static native byte[] InMemoryChannelKeys_get_revocation_base_key(long this_ptr); /// void InMemoryChannelKeys_set_revocation_base_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); public static native void InMemoryChannelKeys_set_revocation_base_key(long this_ptr, long val); /// const uint8_t (*InMemoryChannelKeys_get_payment_key(const LDKInMemoryChannelKeys *this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_payment_key(long this_ptr); + public static native byte[] InMemoryChannelKeys_get_payment_key(long this_ptr); /// void InMemoryChannelKeys_set_payment_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); public static native void InMemoryChannelKeys_set_payment_key(long this_ptr, long val); /// const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const LDKInMemoryChannelKeys *this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_delayed_payment_base_key(long this_ptr); + public static native byte[] InMemoryChannelKeys_get_delayed_payment_base_key(long this_ptr); /// void InMemoryChannelKeys_set_delayed_payment_base_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); public static native void InMemoryChannelKeys_set_delayed_payment_base_key(long this_ptr, long val); /// const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const LDKInMemoryChannelKeys *this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_htlc_base_key(long this_ptr); + public static native byte[] InMemoryChannelKeys_get_htlc_base_key(long this_ptr); /// void InMemoryChannelKeys_set_htlc_base_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); public static native void InMemoryChannelKeys_set_htlc_base_key(long this_ptr, long val); /// const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const LDKInMemoryChannelKeys *this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_commitment_seed(long this_ptr); + public static native byte[] InMemoryChannelKeys_get_commitment_seed(long this_ptr); /// void InMemoryChannelKeys_set_commitment_seed(LDKInMemoryChannelKeys *this_ptr, LDKThirtyTwoBytes val); public static native void InMemoryChannelKeys_set_commitment_seed(long this_ptr, long val); /// MUST_USE_RES LDKInMemoryChannelKeys InMemoryChannelKeys_new(LDKSecretKey funding_key, LDKSecretKey revocation_base_key, LDKSecretKey payment_key, LDKSecretKey delayed_payment_base_key, LDKSecretKey htlc_base_key, LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, LDKC2Tuple_u64u64Z key_derivation_params); @@ -503,7 +503,7 @@ public class bindings { /// void ChannelDetails_free(LDKChannelDetails this_ptr); public static native void ChannelDetails_free(long this_ptr); /// const uint8_t (*ChannelDetails_get_channel_id(const LDKChannelDetails *this_ptr))[32]; - public static native byte[] ChannelDetails_get_channel_id(long this_ptr); + public static native byte[] ChannelDetails_get_channel_id(long this_ptr); /// void ChannelDetails_set_channel_id(LDKChannelDetails *this_ptr, LDKThirtyTwoBytes val); public static native void ChannelDetails_set_channel_id(long this_ptr, long val); /// LDKPublicKey ChannelDetails_get_remote_network_id(const LDKChannelDetails *this_ptr); @@ -533,13 +533,13 @@ public class bindings { /// bool ChannelDetails_get_is_live(const LDKChannelDetails *this_ptr); public static native boolean ChannelDetails_get_is_live(long this_ptr); /// void ChannelDetails_set_is_live(LDKChannelDetails *this_ptr, bool val); - public static native void ChannelDetails_set_is_live(long this_ptr, boolean va); + public static native void ChannelDetails_set_is_live(long this_ptr, boolean val); /// void PaymentSendFailure_free(LDKPaymentSendFailure this_ptr); public static native void PaymentSendFailure_free(long this_ptr); /// MUST_USE_RES LDKChannelManager ChannelManager_new(LDKNetwork network, LDKFeeEstimator fee_est, LDKManyChannelMonitor monitor, LDKBroadcasterInterface tx_broadcaster, LDKLogger logger, LDKKeysInterface keys_manager, LDKUserConfig config, uintptr_t current_blockchain_height); public static native long ChannelManager_new(long network, long fee_est, long monitor, long tx_broadcaster, long logger, long keys_manager, long config, long current_blockchain_height); /// MUST_USE_RES LDKCResult_NoneAPIErrorZ ChannelManager_create_channel(const LDKChannelManager *this_arg, LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_id, LDKUserConfig override_config); - public static native long ChannelManager_create_channel(long this_arg, long their_network_key, long channel_value_satoshis, long push_msa, long ser_id, long override_config); + public static native long ChannelManager_create_channel(long this_arg, long their_network_key, long channel_value_satoshis, long push_msat, long user_id, long override_config); /// MUST_USE_RES LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const LDKChannelManager *this_arg); public static native long ChannelManager_list_channels(long this_arg); /// MUST_USE_RES LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const LDKChannelManager *this_arg); @@ -563,7 +563,7 @@ public class bindings { /// MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const LDKChannelManager *this_arg, const uint8_t (*payment_hash)[32], LDKThirtyTwoBytes payment_secret); public static native boolean ChannelManager_fail_htlc_backwards(long this_arg, byte[] payment_hash, long payment_secret); /// MUST_USE_RES bool ChannelManager_claim_funds(const LDKChannelManager *this_arg, LDKThirtyTwoBytes payment_preimage, LDKThirtyTwoBytes payment_secret, uint64_t expected_amount); - public static native boolean ChannelManager_claim_funds(long this_arg, long payment_preimage, long payment_secret, long expected_amo); + public static native boolean ChannelManager_claim_funds(long this_arg, long payment_preimage, long payment_secret, long expected_amount); /// MUST_USE_RES LDKPublicKey ChannelManager_get_our_node_id(const LDKChannelManager *this_arg); public static native long ChannelManager_get_our_node_id(long this_arg); /// void ChannelManager_channel_monitor_updated(const LDKChannelManager *this_arg, const LDKOutPoint *funding_txo, uint64_t highest_applied_update_id); @@ -647,7 +647,7 @@ public class bindings { /// void ErrorMessage_free(LDKErrorMessage this_ptr); public static native void ErrorMessage_free(long this_ptr); /// const uint8_t (*ErrorMessage_get_channel_id(const LDKErrorMessage *this_ptr))[32]; - public static native byte[] ErrorMessage_get_channel_id(long this_ptr); + public static native byte[] ErrorMessage_get_channel_id(long this_ptr); /// void ErrorMessage_set_channel_id(LDKErrorMessage *this_ptr, LDKThirtyTwoBytes val); public static native void ErrorMessage_set_channel_id(long this_ptr, long val); /// LDKStr ErrorMessage_get_data(const LDKErrorMessage *this_ptr); @@ -679,11 +679,11 @@ public class bindings { /// void OpenChannel_free(LDKOpenChannel this_ptr); public static native void OpenChannel_free(long this_ptr); /// const uint8_t (*OpenChannel_get_chain_hash(const LDKOpenChannel *this_ptr))[32]; - public static native byte[] OpenChannel_get_chain_hash(long this_ptr); + public static native byte[] OpenChannel_get_chain_hash(long this_ptr); /// void OpenChannel_set_chain_hash(LDKOpenChannel *this_ptr, LDKThirtyTwoBytes val); public static native void OpenChannel_set_chain_hash(long this_ptr, long val); /// const uint8_t (*OpenChannel_get_temporary_channel_id(const LDKOpenChannel *this_ptr))[32]; - public static native byte[] OpenChannel_get_temporary_channel_id(long this_ptr); + public static native byte[] OpenChannel_get_temporary_channel_id(long this_ptr); /// void OpenChannel_set_temporary_channel_id(LDKOpenChannel *this_ptr, LDKThirtyTwoBytes val); public static native void OpenChannel_set_temporary_channel_id(long this_ptr, long val); /// uint64_t OpenChannel_get_funding_satoshis(const LDKOpenChannel *this_ptr); @@ -753,7 +753,7 @@ public class bindings { /// void AcceptChannel_free(LDKAcceptChannel this_ptr); public static native void AcceptChannel_free(long this_ptr); /// const uint8_t (*AcceptChannel_get_temporary_channel_id(const LDKAcceptChannel *this_ptr))[32]; - public static native byte[] AcceptChannel_get_temporary_channel_id(long this_ptr); + public static native byte[] AcceptChannel_get_temporary_channel_id(long this_ptr); /// void AcceptChannel_set_temporary_channel_id(LDKAcceptChannel *this_ptr, LDKThirtyTwoBytes val); public static native void AcceptChannel_set_temporary_channel_id(long this_ptr, long val); /// uint64_t AcceptChannel_get_dust_limit_satoshis(const LDKAcceptChannel *this_ptr); @@ -811,11 +811,11 @@ public class bindings { /// void FundingCreated_free(LDKFundingCreated this_ptr); public static native void FundingCreated_free(long this_ptr); /// const uint8_t (*FundingCreated_get_temporary_channel_id(const LDKFundingCreated *this_ptr))[32]; - public static native byte[] FundingCreated_get_temporary_channel_id(long this_ptr); + public static native byte[] FundingCreated_get_temporary_channel_id(long this_ptr); /// void FundingCreated_set_temporary_channel_id(LDKFundingCreated *this_ptr, LDKThirtyTwoBytes val); public static native void FundingCreated_set_temporary_channel_id(long this_ptr, long val); /// const uint8_t (*FundingCreated_get_funding_txid(const LDKFundingCreated *this_ptr))[32]; - public static native byte[] FundingCreated_get_funding_txid(long this_ptr); + public static native byte[] FundingCreated_get_funding_txid(long this_ptr); /// void FundingCreated_set_funding_txid(LDKFundingCreated *this_ptr, LDKThirtyTwoBytes val); public static native void FundingCreated_set_funding_txid(long this_ptr, long val); /// uint16_t FundingCreated_get_funding_output_index(const LDKFundingCreated *this_ptr); @@ -831,7 +831,7 @@ public class bindings { /// void FundingSigned_free(LDKFundingSigned this_ptr); public static native void FundingSigned_free(long this_ptr); /// const uint8_t (*FundingSigned_get_channel_id(const LDKFundingSigned *this_ptr))[32]; - public static native byte[] FundingSigned_get_channel_id(long this_ptr); + public static native byte[] FundingSigned_get_channel_id(long this_ptr); /// void FundingSigned_set_channel_id(LDKFundingSigned *this_ptr, LDKThirtyTwoBytes val); public static native void FundingSigned_set_channel_id(long this_ptr, long val); /// LDKSignature FundingSigned_get_signature(const LDKFundingSigned *this_ptr); @@ -843,7 +843,7 @@ public class bindings { /// void FundingLocked_free(LDKFundingLocked this_ptr); public static native void FundingLocked_free(long this_ptr); /// const uint8_t (*FundingLocked_get_channel_id(const LDKFundingLocked *this_ptr))[32]; - public static native byte[] FundingLocked_get_channel_id(long this_ptr); + public static native byte[] FundingLocked_get_channel_id(long this_ptr); /// void FundingLocked_set_channel_id(LDKFundingLocked *this_ptr, LDKThirtyTwoBytes val); public static native void FundingLocked_set_channel_id(long this_ptr, long val); /// LDKPublicKey FundingLocked_get_next_per_commitment_point(const LDKFundingLocked *this_ptr); @@ -855,7 +855,7 @@ public class bindings { /// void Shutdown_free(LDKShutdown this_ptr); public static native void Shutdown_free(long this_ptr); /// const uint8_t (*Shutdown_get_channel_id(const LDKShutdown *this_ptr))[32]; - public static native byte[] Shutdown_get_channel_id(long this_ptr); + public static native byte[] Shutdown_get_channel_id(long this_ptr); /// void Shutdown_set_channel_id(LDKShutdown *this_ptr, LDKThirtyTwoBytes val); public static native void Shutdown_set_channel_id(long this_ptr, long val); /// LDKu8slice Shutdown_get_scriptpubkey(const LDKShutdown *this_ptr); @@ -867,7 +867,7 @@ public class bindings { /// void ClosingSigned_free(LDKClosingSigned this_ptr); public static native void ClosingSigned_free(long this_ptr); /// const uint8_t (*ClosingSigned_get_channel_id(const LDKClosingSigned *this_ptr))[32]; - public static native byte[] ClosingSigned_get_channel_id(long this_ptr); + public static native byte[] ClosingSigned_get_channel_id(long this_ptr); /// void ClosingSigned_set_channel_id(LDKClosingSigned *this_ptr, LDKThirtyTwoBytes val); public static native void ClosingSigned_set_channel_id(long this_ptr, long val); /// uint64_t ClosingSigned_get_fee_satoshis(const LDKClosingSigned *this_ptr); @@ -883,7 +883,7 @@ public class bindings { /// void UpdateAddHTLC_free(LDKUpdateAddHTLC this_ptr); public static native void UpdateAddHTLC_free(long this_ptr); /// const uint8_t (*UpdateAddHTLC_get_channel_id(const LDKUpdateAddHTLC *this_ptr))[32]; - public static native byte[] UpdateAddHTLC_get_channel_id(long this_ptr); + public static native byte[] UpdateAddHTLC_get_channel_id(long this_ptr); /// void UpdateAddHTLC_set_channel_id(LDKUpdateAddHTLC *this_ptr, LDKThirtyTwoBytes val); public static native void UpdateAddHTLC_set_channel_id(long this_ptr, long val); /// uint64_t UpdateAddHTLC_get_htlc_id(const LDKUpdateAddHTLC *this_ptr); @@ -895,7 +895,7 @@ public class bindings { /// void UpdateAddHTLC_set_amount_msat(LDKUpdateAddHTLC *this_ptr, uint64_t val); public static native void UpdateAddHTLC_set_amount_msat(long this_ptr, long val); /// const uint8_t (*UpdateAddHTLC_get_payment_hash(const LDKUpdateAddHTLC *this_ptr))[32]; - public static native byte[] UpdateAddHTLC_get_payment_hash(long this_ptr); + public static native byte[] UpdateAddHTLC_get_payment_hash(long this_ptr); /// void UpdateAddHTLC_set_payment_hash(LDKUpdateAddHTLC *this_ptr, LDKThirtyTwoBytes val); public static native void UpdateAddHTLC_set_payment_hash(long this_ptr, long val); /// uint32_t UpdateAddHTLC_get_cltv_expiry(const LDKUpdateAddHTLC *this_ptr); @@ -905,7 +905,7 @@ public class bindings { /// void UpdateFulfillHTLC_free(LDKUpdateFulfillHTLC this_ptr); public static native void UpdateFulfillHTLC_free(long this_ptr); /// const uint8_t (*UpdateFulfillHTLC_get_channel_id(const LDKUpdateFulfillHTLC *this_ptr))[32]; - public static native byte[] UpdateFulfillHTLC_get_channel_id(long this_ptr); + public static native byte[] UpdateFulfillHTLC_get_channel_id(long this_ptr); /// void UpdateFulfillHTLC_set_channel_id(LDKUpdateFulfillHTLC *this_ptr, LDKThirtyTwoBytes val); public static native void UpdateFulfillHTLC_set_channel_id(long this_ptr, long val); /// uint64_t UpdateFulfillHTLC_get_htlc_id(const LDKUpdateFulfillHTLC *this_ptr); @@ -913,7 +913,7 @@ public class bindings { /// void UpdateFulfillHTLC_set_htlc_id(LDKUpdateFulfillHTLC *this_ptr, uint64_t val); public static native void UpdateFulfillHTLC_set_htlc_id(long this_ptr, long val); /// const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const LDKUpdateFulfillHTLC *this_ptr))[32]; - public static native byte[] UpdateFulfillHTLC_get_payment_preimage(long this_ptr); + public static native byte[] UpdateFulfillHTLC_get_payment_preimage(long this_ptr); /// void UpdateFulfillHTLC_set_payment_preimage(LDKUpdateFulfillHTLC *this_ptr, LDKThirtyTwoBytes val); public static native void UpdateFulfillHTLC_set_payment_preimage(long this_ptr, long val); /// MUST_USE_RES LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, LDKThirtyTwoBytes payment_preimage_arg); @@ -921,7 +921,7 @@ public class bindings { /// void UpdateFailHTLC_free(LDKUpdateFailHTLC this_ptr); public static native void UpdateFailHTLC_free(long this_ptr); /// const uint8_t (*UpdateFailHTLC_get_channel_id(const LDKUpdateFailHTLC *this_ptr))[32]; - public static native byte[] UpdateFailHTLC_get_channel_id(long this_ptr); + public static native byte[] UpdateFailHTLC_get_channel_id(long this_ptr); /// void UpdateFailHTLC_set_channel_id(LDKUpdateFailHTLC *this_ptr, LDKThirtyTwoBytes val); public static native void UpdateFailHTLC_set_channel_id(long this_ptr, long val); /// uint64_t UpdateFailHTLC_get_htlc_id(const LDKUpdateFailHTLC *this_ptr); @@ -931,7 +931,7 @@ public class bindings { /// void UpdateFailMalformedHTLC_free(LDKUpdateFailMalformedHTLC this_ptr); public static native void UpdateFailMalformedHTLC_free(long this_ptr); /// const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const LDKUpdateFailMalformedHTLC *this_ptr))[32]; - public static native byte[] UpdateFailMalformedHTLC_get_channel_id(long this_ptr); + public static native byte[] UpdateFailMalformedHTLC_get_channel_id(long this_ptr); /// void UpdateFailMalformedHTLC_set_channel_id(LDKUpdateFailMalformedHTLC *this_ptr, LDKThirtyTwoBytes val); public static native void UpdateFailMalformedHTLC_set_channel_id(long this_ptr, long val); /// uint64_t UpdateFailMalformedHTLC_get_htlc_id(const LDKUpdateFailMalformedHTLC *this_ptr); @@ -945,7 +945,7 @@ public class bindings { /// void CommitmentSigned_free(LDKCommitmentSigned this_ptr); public static native void CommitmentSigned_free(long this_ptr); /// const uint8_t (*CommitmentSigned_get_channel_id(const LDKCommitmentSigned *this_ptr))[32]; - public static native byte[] CommitmentSigned_get_channel_id(long this_ptr); + public static native byte[] CommitmentSigned_get_channel_id(long this_ptr); /// void CommitmentSigned_set_channel_id(LDKCommitmentSigned *this_ptr, LDKThirtyTwoBytes val); public static native void CommitmentSigned_set_channel_id(long this_ptr, long val); /// LDKSignature CommitmentSigned_get_signature(const LDKCommitmentSigned *this_ptr); @@ -959,11 +959,11 @@ public class bindings { /// void RevokeAndACK_free(LDKRevokeAndACK this_ptr); public static native void RevokeAndACK_free(long this_ptr); /// const uint8_t (*RevokeAndACK_get_channel_id(const LDKRevokeAndACK *this_ptr))[32]; - public static native byte[] RevokeAndACK_get_channel_id(long this_ptr); + public static native byte[] RevokeAndACK_get_channel_id(long this_ptr); /// void RevokeAndACK_set_channel_id(LDKRevokeAndACK *this_ptr, LDKThirtyTwoBytes val); public static native void RevokeAndACK_set_channel_id(long this_ptr, long val); /// const uint8_t (*RevokeAndACK_get_per_commitment_secret(const LDKRevokeAndACK *this_ptr))[32]; - public static native byte[] RevokeAndACK_get_per_commitment_secret(long this_ptr); + public static native byte[] RevokeAndACK_get_per_commitment_secret(long this_ptr); /// void RevokeAndACK_set_per_commitment_secret(LDKRevokeAndACK *this_ptr, LDKThirtyTwoBytes val); public static native void RevokeAndACK_set_per_commitment_secret(long this_ptr, long val); /// LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const LDKRevokeAndACK *this_ptr); @@ -975,7 +975,7 @@ public class bindings { /// void UpdateFee_free(LDKUpdateFee this_ptr); public static native void UpdateFee_free(long this_ptr); /// const uint8_t (*UpdateFee_get_channel_id(const LDKUpdateFee *this_ptr))[32]; - public static native byte[] UpdateFee_get_channel_id(long this_ptr); + public static native byte[] UpdateFee_get_channel_id(long this_ptr); /// void UpdateFee_set_channel_id(LDKUpdateFee *this_ptr, LDKThirtyTwoBytes val); public static native void UpdateFee_set_channel_id(long this_ptr, long val); /// uint32_t UpdateFee_get_feerate_per_kw(const LDKUpdateFee *this_ptr); @@ -987,7 +987,7 @@ public class bindings { /// void DataLossProtect_free(LDKDataLossProtect this_ptr); public static native void DataLossProtect_free(long this_ptr); /// const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const LDKDataLossProtect *this_ptr))[32]; - public static native byte[] DataLossProtect_get_your_last_per_commitment_secret(long this_ptr); + public static native byte[] DataLossProtect_get_your_last_per_commitment_secret(long this_ptr); /// void DataLossProtect_set_your_last_per_commitment_secret(LDKDataLossProtect *this_ptr, LDKThirtyTwoBytes val); public static native void DataLossProtect_set_your_last_per_commitment_secret(long this_ptr, long val); /// LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const LDKDataLossProtect *this_ptr); @@ -999,7 +999,7 @@ public class bindings { /// void ChannelReestablish_free(LDKChannelReestablish this_ptr); public static native void ChannelReestablish_free(long this_ptr); /// const uint8_t (*ChannelReestablish_get_channel_id(const LDKChannelReestablish *this_ptr))[32]; - public static native byte[] ChannelReestablish_get_channel_id(long this_ptr); + public static native byte[] ChannelReestablish_get_channel_id(long this_ptr); /// void ChannelReestablish_set_channel_id(LDKChannelReestablish *this_ptr, LDKThirtyTwoBytes val); public static native void ChannelReestablish_set_channel_id(long this_ptr, long val); /// uint64_t ChannelReestablish_get_next_local_commitment_number(const LDKChannelReestablish *this_ptr); @@ -1013,7 +1013,7 @@ public class bindings { /// void AnnouncementSignatures_free(LDKAnnouncementSignatures this_ptr); public static native void AnnouncementSignatures_free(long this_ptr); /// const uint8_t (*AnnouncementSignatures_get_channel_id(const LDKAnnouncementSignatures *this_ptr))[32]; - public static native byte[] AnnouncementSignatures_get_channel_id(long this_ptr); + public static native byte[] AnnouncementSignatures_get_channel_id(long this_ptr); /// void AnnouncementSignatures_set_channel_id(LDKAnnouncementSignatures *this_ptr, LDKThirtyTwoBytes val); public static native void AnnouncementSignatures_set_channel_id(long this_ptr, long val); /// uint64_t AnnouncementSignatures_get_short_channel_id(const LDKAnnouncementSignatures *this_ptr); @@ -1043,11 +1043,11 @@ public class bindings { /// void UnsignedNodeAnnouncement_set_node_id(LDKUnsignedNodeAnnouncement *this_ptr, LDKPublicKey val); public static native void UnsignedNodeAnnouncement_set_node_id(long this_ptr, long val); /// const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const LDKUnsignedNodeAnnouncement *this_ptr))[3]; - public static native byte[] UnsignedNodeAnnouncement_get_rgb(long this_ptr); + public static native byte[] UnsignedNodeAnnouncement_get_rgb(long this_ptr); /// void UnsignedNodeAnnouncement_set_rgb(LDKUnsignedNodeAnnouncement *this_ptr, LDKThreeBytes val); public static native void UnsignedNodeAnnouncement_set_rgb(long this_ptr, long val); /// const uint8_t (*UnsignedNodeAnnouncement_get_alias(const LDKUnsignedNodeAnnouncement *this_ptr))[32]; - public static native byte[] UnsignedNodeAnnouncement_get_alias(long this_ptr); + public static native byte[] UnsignedNodeAnnouncement_get_alias(long this_ptr); /// void UnsignedNodeAnnouncement_set_alias(LDKUnsignedNodeAnnouncement *this_ptr, LDKThirtyTwoBytes val); public static native void UnsignedNodeAnnouncement_set_alias(long this_ptr, long val); /// void UnsignedNodeAnnouncement_set_addresses(LDKUnsignedNodeAnnouncement *this_ptr, LDKCVec_NetAddressZ val); @@ -1067,7 +1067,7 @@ public class bindings { /// void UnsignedChannelAnnouncement_free(LDKUnsignedChannelAnnouncement this_ptr); public static native void UnsignedChannelAnnouncement_free(long this_ptr); /// const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const LDKUnsignedChannelAnnouncement *this_ptr))[32]; - public static native byte[] UnsignedChannelAnnouncement_get_chain_hash(long this_ptr); + public static native byte[] UnsignedChannelAnnouncement_get_chain_hash(long this_ptr); /// void UnsignedChannelAnnouncement_set_chain_hash(LDKUnsignedChannelAnnouncement *this_ptr, LDKThirtyTwoBytes val); public static native void UnsignedChannelAnnouncement_set_chain_hash(long this_ptr, long val); /// uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const LDKUnsignedChannelAnnouncement *this_ptr); @@ -1117,7 +1117,7 @@ public class bindings { /// void UnsignedChannelUpdate_free(LDKUnsignedChannelUpdate this_ptr); public static native void UnsignedChannelUpdate_free(long this_ptr); /// const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const LDKUnsignedChannelUpdate *this_ptr))[32]; - public static native byte[] UnsignedChannelUpdate_get_chain_hash(long this_ptr); + public static native byte[] UnsignedChannelUpdate_get_chain_hash(long this_ptr); /// void UnsignedChannelUpdate_set_chain_hash(LDKUnsignedChannelUpdate *this_ptr, LDKThirtyTwoBytes val); public static native void UnsignedChannelUpdate_set_chain_hash(long this_ptr, long val); /// uint64_t UnsignedChannelUpdate_get_short_channel_id(const LDKUnsignedChannelUpdate *this_ptr); @@ -1323,7 +1323,7 @@ public class bindings { /// bool PeerHandleError_get_no_connection_possible(const LDKPeerHandleError *this_ptr); public static native boolean PeerHandleError_get_no_connection_possible(long this_ptr); /// void PeerHandleError_set_no_connection_possible(LDKPeerHandleError *this_ptr, bool val); - public static native void PeerHandleError_set_no_connection_possible(long this_ptr, boolean va); + public static native void PeerHandleError_set_no_connection_possible(long this_ptr, boolean val); /// MUST_USE_RES LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg); public static native long PeerHandleError_new(boolean no_connection_possible_arg); /// void PeerManager_free(LDKPeerManager this_ptr); @@ -1347,7 +1347,7 @@ public class bindings { /// void PeerManager_timer_tick_occured(const LDKPeerManager *this_arg); public static native void PeerManager_timer_tick_occured(long this_arg); /// LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx); - public static native long build_commitment_secret(byte[] commitment_seed, long dx); + public static native long build_commitment_secret(byte[] commitment_seed, long idx); /// void TxCreationKeys_free(LDKTxCreationKeys this_ptr); public static native void TxCreationKeys_free(long this_ptr); /// LDKPublicKey TxCreationKeys_get_per_commitment_point(const LDKTxCreationKeys *this_ptr); @@ -1421,7 +1421,7 @@ public class bindings { /// bool HTLCOutputInCommitment_get_offered(const LDKHTLCOutputInCommitment *this_ptr); public static native boolean HTLCOutputInCommitment_get_offered(long this_ptr); /// void HTLCOutputInCommitment_set_offered(LDKHTLCOutputInCommitment *this_ptr, bool val); - public static native void HTLCOutputInCommitment_set_offered(long this_ptr, boolean va); + public static native void HTLCOutputInCommitment_set_offered(long this_ptr, boolean val); /// uint64_t HTLCOutputInCommitment_get_amount_msat(const LDKHTLCOutputInCommitment *this_ptr); public static native long HTLCOutputInCommitment_get_amount_msat(long this_ptr); /// void HTLCOutputInCommitment_set_amount_msat(LDKHTLCOutputInCommitment *this_ptr, uint64_t val); @@ -1431,7 +1431,7 @@ public class bindings { /// void HTLCOutputInCommitment_set_cltv_expiry(LDKHTLCOutputInCommitment *this_ptr, uint32_t val); public static native void HTLCOutputInCommitment_set_cltv_expiry(long this_ptr, int val); /// const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const LDKHTLCOutputInCommitment *this_ptr))[32]; - public static native byte[] HTLCOutputInCommitment_get_payment_hash(long this_ptr); + public static native byte[] HTLCOutputInCommitment_get_payment_hash(long this_ptr); /// void HTLCOutputInCommitment_set_payment_hash(LDKHTLCOutputInCommitment *this_ptr, LDKThirtyTwoBytes val); public static native void HTLCOutputInCommitment_set_payment_hash(long this_ptr, long val); /// LDKCVec_u8Z HTLCOutputInCommitment_write(const LDKHTLCOutputInCommitment *obj); @@ -1533,7 +1533,7 @@ public class bindings { /// MUST_USE_RES LDKRouteHint RouteHint_new(LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg); public static native long RouteHint_new(long src_node_id_arg, long short_channel_id_arg, long fees_arg, long cltv_expiry_delta_arg, long htlc_minimum_msat_arg); /// LDKCResult_RouteLightningErrorZ get_route(LDKPublicKey our_node_id, const LDKNetworkGraph *network, LDKPublicKey target, LDKCVec_ChannelDetailsZ *first_hops, LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, LDKLogger logger); - public static native long get_route(long our_node_id, long network, long target, long first_hops, long last_hops, long final_value_msa, int final_cltv, long logger); + public static native long get_route(long our_node_id, long network, long target, long first_hops, long last_hops, long final_value_msat, int final_cltv, long logger); /// void NetworkGraph_free(LDKNetworkGraph this_ptr); public static native void NetworkGraph_free(long this_ptr); /// void LockedNetworkGraph_free(LDKLockedNetworkGraph this_ptr); @@ -1559,7 +1559,7 @@ public class bindings { /// bool DirectionalChannelInfo_get_enabled(const LDKDirectionalChannelInfo *this_ptr); public static native boolean DirectionalChannelInfo_get_enabled(long this_ptr); /// void DirectionalChannelInfo_set_enabled(LDKDirectionalChannelInfo *this_ptr, bool val); - public static native void DirectionalChannelInfo_set_enabled(long this_ptr, boolean va); + public static native void DirectionalChannelInfo_set_enabled(long this_ptr, boolean val); /// uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const LDKDirectionalChannelInfo *this_ptr); public static native long DirectionalChannelInfo_get_cltv_expiry_delta(long this_ptr); /// void DirectionalChannelInfo_set_cltv_expiry_delta(LDKDirectionalChannelInfo *this_ptr, uint16_t val); @@ -1617,11 +1617,11 @@ public class bindings { /// void NodeAnnouncementInfo_set_last_update(LDKNodeAnnouncementInfo *this_ptr, uint32_t val); public static native void NodeAnnouncementInfo_set_last_update(long this_ptr, int val); /// const uint8_t (*NodeAnnouncementInfo_get_rgb(const LDKNodeAnnouncementInfo *this_ptr))[3]; - public static native byte[] NodeAnnouncementInfo_get_rgb(long this_ptr); + public static native byte[] NodeAnnouncementInfo_get_rgb(long this_ptr); /// void NodeAnnouncementInfo_set_rgb(LDKNodeAnnouncementInfo *this_ptr, LDKThreeBytes val); public static native void NodeAnnouncementInfo_set_rgb(long this_ptr, long val); /// const uint8_t (*NodeAnnouncementInfo_get_alias(const LDKNodeAnnouncementInfo *this_ptr))[32]; - public static native byte[] NodeAnnouncementInfo_get_alias(long this_ptr); + public static native byte[] NodeAnnouncementInfo_get_alias(long this_ptr); /// void NodeAnnouncementInfo_set_alias(LDKNodeAnnouncementInfo *this_ptr, LDKThirtyTwoBytes val); public static native void NodeAnnouncementInfo_set_alias(long this_ptr, long val); /// void NodeAnnouncementInfo_set_addresses(LDKNodeAnnouncementInfo *this_ptr, LDKCVec_NetAddressZ val); diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 771f773c..fd69cfc1 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -1545,9 +1545,9 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1ge return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean va) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr; - return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, va); + return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val); } JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -1606,9 +1606,9 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announ return ChannelConfig_get_announced_channel(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean va) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr; - return ChannelConfig_set_announced_channel(this_ptr_conv, va); + return ChannelConfig_set_announced_channel(this_ptr_conv, val); } JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -1616,9 +1616,9 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean va) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr; - return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, va); + return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val); } JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * _env, jclass _b, jint fee_proportional_millionths_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) { @@ -1831,14 +1831,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1register_1liste return BlockNotifier_register_listener(this_arg_conv, listener_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jlong block, jint heigh) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jlong block, jint height) { LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg; LDKu8slice block_conv = *(LDKu8slice*)block; free((void*)block); - return BlockNotifier_block_connected(this_arg_conv, block_conv, heigh); + return BlockNotifier_block_connected(this_arg_conv, block_conv, height); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1connected_1checked(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint heigh, jlong txn_matched, jlong indexes_of_txn_matched) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1connected_1checked(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint height, jlong txn_matched, jlong indexes_of_txn_matched) { LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg; unsigned char header_arr[80]; (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr); @@ -1847,15 +1847,15 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1conn free((void*)txn_matched); LDKusizeslice indexes_of_txn_matched_conv = *(LDKusizeslice*)indexes_of_txn_matched; free((void*)indexes_of_txn_matched); - return BlockNotifier_block_connected_checked(this_arg_conv, header_ref, heigh, txn_matched_conv, indexes_of_txn_matched_conv); + return BlockNotifier_block_connected_checked(this_arg_conv, header_ref, height, txn_matched_conv, indexes_of_txn_matched_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_heigh) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) { LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg; unsigned char header_arr[80]; (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr); unsigned char (*header_ref)[80] = &header_arr; - return BlockNotifier_block_disconnected(this_arg_conv, header_ref, disconnected_heigh); + return BlockNotifier_block_disconnected(this_arg_conv, header_ref, disconnected_height); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -1896,7 +1896,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, return OutPoint_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv)); @@ -1985,7 +1985,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIE return InMemoryChannelKeys_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv)); @@ -1999,7 +1999,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1fund return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv)); @@ -2013,7 +2013,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revo return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv)); @@ -2027,7 +2027,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1paym return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv)); @@ -2041,7 +2041,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1dela return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv)); @@ -2055,7 +2055,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv)); @@ -2188,7 +2188,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * return ChannelDetails_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv)); @@ -2278,9 +2278,9 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1l return ChannelDetails_get_is_live(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean va) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr; - return ChannelDetails_set_is_live(this_ptr_conv, va); + return ChannelDetails_set_is_live(this_ptr_conv, val); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -2315,7 +2315,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv * return (long)ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong their_network_key, jlong channel_value_satoshis, jlong push_msa, jlong ser_id, jlong override_config) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong their_network_key, jlong channel_value_satoshis, jlong push_msat, jlong user_id, jlong override_config) { LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg; LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key; free((void*)their_network_key); @@ -2323,7 +2323,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1chann free((void*)override_config); override_config_conv._underlying_ref = false; LDKCResult_NoneAPIErrorZ* ret = malloc(sizeof(LDKCResult_NoneAPIErrorZ)); - *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msa, ser_id, override_config_conv); + *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv); return (long)ret; } @@ -2418,13 +2418,13 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv * _env, jclass _b, jlong this_arg, jlong payment_preimage, jlong payment_secret, jlong expected_amo) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv * _env, jclass _b, jlong this_arg, jlong payment_preimage, jlong payment_secret, jlong expected_amount) { LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg; LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage; free((void*)payment_preimage); LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret; free((void*)payment_secret); - return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amo); + return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount); } JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) { @@ -2727,7 +2727,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _e return ErrorMessage_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv)); @@ -2852,7 +2852,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _en return OpenChannel_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv)); @@ -2866,7 +2866,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash( return OpenChannel_set_chain_hash(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv)); @@ -3079,7 +3079,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _ return AcceptChannel_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv)); @@ -3262,7 +3262,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * return FundingCreated_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv)); @@ -3276,7 +3276,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv)); @@ -3341,7 +3341,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _ return FundingSigned_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv)); @@ -3388,7 +3388,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _ return FundingLocked_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv)); @@ -3435,7 +3435,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, return Shutdown_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv)); @@ -3482,7 +3482,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _ return ClosingSigned_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv)); @@ -3539,7 +3539,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _ return UpdateAddHTLC_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv)); @@ -3573,7 +3573,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1ms return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv)); @@ -3604,7 +3604,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv return UpdateFulfillHTLC_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv)); @@ -3628,7 +3628,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv)); @@ -3661,7 +3661,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * return UpdateFailHTLC_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv)); @@ -3692,7 +3692,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free( return UpdateFailMalformedHTLC_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv)); @@ -3737,7 +3737,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv return CommitmentSigned_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv)); @@ -3793,7 +3793,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _e return RevokeAndACK_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv)); @@ -3807,7 +3807,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id return RevokeAndACK_set_channel_id(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv)); @@ -3856,7 +3856,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, return UpdateFee_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv)); @@ -3897,7 +3897,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * return DataLossProtect_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv)); @@ -3944,7 +3944,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEn return ChannelReestablish_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv)); @@ -3985,7 +3985,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(J return AnnouncementSignatures_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv)); @@ -4088,7 +4088,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv)); @@ -4102,7 +4102,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv)); @@ -4181,7 +4181,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1f return UnsignedChannelAnnouncement_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv)); @@ -4367,7 +4367,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JN return UnsignedChannelUpdate_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv)); @@ -5171,9 +5171,9 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1 return PeerHandleError_get_no_connection_possible(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean va) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr; - return PeerHandleError_set_no_connection_possible(this_ptr_conv, va); + return PeerHandleError_set_no_connection_possible(this_ptr_conv, val); } JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) { @@ -5270,12 +5270,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occu return PeerManager_timer_tick_occured(this_arg_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong dx) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) { unsigned char commitment_seed_arr[32]; (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr); unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr; LDKThirtyTwoBytes* ret = malloc(sizeof(LDKThirtyTwoBytes)); - *ret = build_commitment_secret(commitment_seed_ref, dx); + *ret = build_commitment_secret(commitment_seed_ref, idx); return (long)ret; } @@ -5577,9 +5577,9 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1ge return HTLCOutputInCommitment_get_offered(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean va) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr; - return HTLCOutputInCommitment_set_offered(this_ptr_conv, va); + return HTLCOutputInCommitment_set_offered(this_ptr_conv, val); } JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -5602,7 +5602,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1c return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv)); @@ -5997,7 +5997,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv * _env, return (long)ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv * _env, jclass _b, jlong our_node_id, jlong network, jlong target, jlong first_hops, jlong last_hops, jlong final_value_msa, jint final_cltv, jlong logger) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv * _env, jclass _b, jlong our_node_id, jlong network, jlong target, jlong first_hops, jlong last_hops, jlong final_value_msat, jint final_cltv, jlong logger) { LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id; free((void*)our_node_id); LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network; @@ -6009,7 +6009,7 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv * _env, jcl LDKLogger logger_conv = *(LDKLogger*)logger; free((void*)logger); LDKCResult_RouteLightningErrorZ* ret = malloc(sizeof(LDKCResult_RouteLightningErrorZ)); - *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msa, final_cltv, logger_conv); + *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv); return (long)ret; } @@ -6108,9 +6108,9 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1ge return DirectionalChannelInfo_get_enabled(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean va) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr; - return DirectionalChannelInfo_set_enabled(this_ptr_conv, va); + return DirectionalChannelInfo_set_enabled(this_ptr_conv, val); } JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -6309,7 +6309,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1las return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv)); @@ -6323,7 +6323,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) { +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv)); -- 2.39.5