From: Matt Corallo Date: Wed, 31 Mar 2021 19:39:27 +0000 (-0400) Subject: Update auto-generated bindings X-Git-Tag: v0.0.98~3^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=7cede693022f65adf9b93bfda7a462481e30c1ef;p=ldk-java Update auto-generated bindings --- diff --git a/liblightningjni_debug.so b/liblightningjni_debug.so index 3875f117..15cc64db 100755 Binary files a/liblightningjni_debug.so and b/liblightningjni_debug.so differ diff --git a/liblightningjni_release.so b/liblightningjni_release.so index b90244bb..be4d3c92 100755 Binary files a/liblightningjni_release.so and b/liblightningjni_release.so differ diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 47752cfb..5a4dc21e 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -2163,6 +2163,8 @@ public class bindings { public static native void ChannelManager_block_connected(long this_arg, byte[] header, long[] txdata, int height); // void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]); public static native void ChannelManager_block_disconnected(long this_arg, byte[] header); + // MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait); + public static native boolean ChannelManager_await_persistable_update_timeout(long this_arg, long max_wait); // void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native void ChannelManager_await_persistable_update(long this_arg); // struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index c5afb196..d0de49a2 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -394,6 +394,18 @@ public class ChannelManager extends CommonBase { bindings.ChannelManager_block_disconnected(this.ptr, header); } + /** + * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool + * indicating whether persistence is necessary. Only one listener on + * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken + * up. + * Note that the feature `allow_wallclock_use` must be enabled to use this function. + */ + public boolean await_persistable_update_timeout(long max_wait) { + boolean ret = bindings.ChannelManager_await_persistable_update_timeout(this.ptr, max_wait); + return ret; + } + /** * Blocks until ChannelManager needs to be persisted. Only one listener on * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 15617049..221801aa 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -12722,6 +12722,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconn ChannelManager_block_disconnected(&this_arg_conv, header_ref); } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update_1timeout(JNIEnv *env, jclass clz, int64_t this_arg, int64_t max_wait) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jboolean ret_val = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update(JNIEnv *env, jclass clz, int64_t this_arg) { LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index 7ae607ba..b97895f7 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -8287,6 +8287,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connect JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected (JNIEnv *, jclass, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_await_persistable_update_timeout + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update_1timeout + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelManager_await_persistable_update diff --git a/ts/bindings.c b/ts/bindings.c index 0655425c..5b6b0774 100644 --- a/ts/bindings.c +++ b/ts/bindings.c @@ -11492,6 +11492,14 @@ void __attribute__((visibility("default"))) TS_ChannelManager_block_disconnecte ChannelManager_block_disconnected(&this_arg_conv, header_ref); } +jboolean __attribute__((visibility("default"))) TS_ChannelManager_await_persistable_update_timeout(uint32_t this_arg, int64_t max_wait) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jboolean ret_val = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); + return ret_val; +} + void __attribute__((visibility("default"))) TS_ChannelManager_await_persistable_update(uint32_t this_arg) { LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); diff --git a/ts/bindings.ts b/ts/bindings.ts index 78842cba..3a8bfbe9 100644 --- a/ts/bindings.ts +++ b/ts/bindings.ts @@ -6634,6 +6634,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelManager_block_disconnected(this_arg, encodeArray(header)); // debug statements here } + // MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait); + export function ChannelManager_await_persistable_update_timeout(this_arg: number, max_wait: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelManager_await_persistable_update_timeout(this_arg, max_wait); + return nativeResponseValue; + } // void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg); export function ChannelManager_await_persistable_update(this_arg: number): void { if(!isWasmInitialized) { diff --git a/ts/structs/ChannelManager.ts b/ts/structs/ChannelManager.ts index 72337ed6..003e029f 100644 --- a/ts/structs/ChannelManager.ts +++ b/ts/structs/ChannelManager.ts @@ -153,6 +153,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ChannelManager_block_disconnected(this.ptr, header); } + public boolean await_persistable_update_timeout(number max_wait) { + boolean ret = bindings.ChannelManager_await_persistable_update_timeout(this.ptr, max_wait); + return ret; + } + public void await_persistable_update() { bindings.ChannelManager_await_persistable_update(this.ptr); }