[Java] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / src / main / java / org / ldk / structs / EcdsaChannelSigner.java
index a84b6c71e0aafc1b0af8aff6ed895b07fe67d43a..d5478d3655d26a7d115c1acda4f6b08b7d5aad2b 100644 (file)
@@ -21,7 +21,7 @@ public class EcdsaChannelSigner extends CommonBase {
        final bindings.LDKEcdsaChannelSigner bindings_instance;
        EcdsaChannelSigner(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
        private EcdsaChannelSigner(bindings.LDKEcdsaChannelSigner arg, bindings.LDKChannelSigner ChannelSigner, ChannelPublicKeys pubkeys) {
-               super(bindings.LDKEcdsaChannelSigner_new(arg, ChannelSigner, pubkeys == null ? 0 : pubkeys.clone_ptr()));
+               super(bindings.LDKEcdsaChannelSigner_new(arg, ChannelSigner, pubkeys.clone_ptr()));
                this.ptrs_to.add(arg);
                this.ptrs_to.add(ChannelSigner);
                this.bindings_instance = arg;
@@ -71,6 +71,13 @@ public class EcdsaChannelSigner extends CommonBase {
                 * This may be called multiple times for the same transaction.
                 * 
                 * An external signer implementation should check that the commitment has not been revoked.
+                * 
+                * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+                * signature and should be retried later. Once the signer is ready to provide a signature after
+                * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+                * monitor.
+                * 
+                * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
                 */
                Result_ECDSASignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction commitment_tx);
                /**
@@ -88,6 +95,13 @@ public class EcdsaChannelSigner extends CommonBase {
                 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
                 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
                 * so).
+                * 
+                * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+                * signature and should be retried later. Once the signer is ready to provide a signature after
+                * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+                * monitor.
+                * 
+                * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
                 */
                Result_ECDSASignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key);
                /**
@@ -109,6 +123,13 @@ public class EcdsaChannelSigner extends CommonBase {
                 * 
                 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
                 * (which is committed to in the BIP 143 signatures).
+                * 
+                * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+                * signature and should be retried later. Once the signer is ready to provide a signature after
+                * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+                * monitor.
+                * 
+                * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
                 */
                Result_ECDSASignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc);
                /**
@@ -120,8 +141,14 @@ public class EcdsaChannelSigner extends CommonBase {
                 * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
                 * broadcasts it before receiving the update for the latest commitment transaction.
                 * 
+                * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+                * signature and should be retried later. Once the signer is ready to provide a signature after
+                * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+                * monitor.
+                * 
                 * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
                 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
+                * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
                 */
                Result_ECDSASignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, HTLCDescriptor htlc_descriptor);
                /**
@@ -142,6 +169,13 @@ public class EcdsaChannelSigner extends CommonBase {
                 * detected onchain. It has been generated by our counterparty and is used to derive
                 * channel state keys, which are then included in the witness script and committed to in the
                 * BIP 143 signature.
+                * 
+                * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+                * signature and should be retried later. Once the signer is ready to provide a signature after
+                * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+                * monitor.
+                * 
+                * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
                 */
                Result_ECDSASignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc);
                /**
@@ -154,6 +188,13 @@ public class EcdsaChannelSigner extends CommonBase {
                /**
                 * Computes the signature for a commitment transaction's anchor output used as an
                 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
+                * 
+                * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+                * signature and should be retried later. Once the signer is ready to provide a signature after
+                * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+                * monitor.
+                * 
+                * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
                 */
                Result_ECDSASignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input);
                /**
@@ -179,61 +220,61 @@ public class EcdsaChannelSigner extends CommonBase {
                                org.ldk.structs.CommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new org.ldk.structs.CommitmentTransaction(null, commitment_tx); }
                                Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv, inbound_htlc_preimages, outbound_htlc_preimages);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                return result;
                        }
                        @Override public long sign_holder_commitment(long commitment_tx) {
                                org.ldk.structs.HolderCommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, commitment_tx); }
                                Result_ECDSASignatureNoneZ ret = arg.sign_holder_commitment(commitment_tx_hu_conv);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                return result;
                        }
                        @Override public long sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) {
                                Result_ECDSASignatureNoneZ ret = arg.sign_justice_revoked_output(justice_tx, input, amount, per_commitment_key);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                return result;
                        }
                        @Override public long sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc) {
                                org.ldk.structs.HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, htlc); }
                                Result_ECDSASignatureNoneZ ret = arg.sign_justice_revoked_htlc(justice_tx, input, amount, per_commitment_key, htlc_hu_conv);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                return result;
                        }
                        @Override public long sign_holder_htlc_transaction(byte[] htlc_tx, long input, long htlc_descriptor) {
                                org.ldk.structs.HTLCDescriptor htlc_descriptor_hu_conv = null; if (htlc_descriptor < 0 || htlc_descriptor > 4096) { htlc_descriptor_hu_conv = new org.ldk.structs.HTLCDescriptor(null, htlc_descriptor); }
                                Result_ECDSASignatureNoneZ ret = arg.sign_holder_htlc_transaction(htlc_tx, input, htlc_descriptor_hu_conv);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                return result;
                        }
                        @Override public long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc) {
                                org.ldk.structs.HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, htlc); }
                                Result_ECDSASignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                return result;
                        }
                        @Override public long sign_closing_transaction(long closing_tx) {
                                org.ldk.structs.ClosingTransaction closing_tx_hu_conv = null; if (closing_tx < 0 || closing_tx > 4096) { closing_tx_hu_conv = new org.ldk.structs.ClosingTransaction(null, closing_tx); }
                                Result_ECDSASignatureNoneZ ret = arg.sign_closing_transaction(closing_tx_hu_conv);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                return result;
                        }
                        @Override public long sign_holder_anchor_input(byte[] anchor_tx, long input) {
                                Result_ECDSASignatureNoneZ ret = arg.sign_holder_anchor_input(anchor_tx, input);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                return result;
                        }
                        @Override public long sign_channel_announcement_with_funding_key(long msg) {
                                org.ldk.structs.UnsignedChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, msg); }
                                Result_ECDSASignatureNoneZ ret = arg.sign_channel_announcement_with_funding_key(msg_hu_conv);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                return result;
                        }
                }, ChannelSigner.new_impl(ChannelSigner_impl, pubkeys).bindings_instance, pubkeys);
@@ -266,7 +307,7 @@ public class EcdsaChannelSigner extends CommonBase {
         * irrelevant or duplicate preimages.
         */
        public Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ sign_counterparty_commitment(org.ldk.structs.CommitmentTransaction commitment_tx, byte[][] inbound_htlc_preimages, byte[][] outbound_htlc_preimages) {
-               long ret = bindings.EcdsaChannelSigner_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr, inbound_htlc_preimages != null ? Arrays.stream(inbound_htlc_preimages).map(inbound_htlc_preimages_conv_8 -> InternalUtils.check_arr_len(inbound_htlc_preimages_conv_8, 32)).toArray(byte[][]::new) : null, outbound_htlc_preimages != null ? Arrays.stream(outbound_htlc_preimages).map(outbound_htlc_preimages_conv_8 -> InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32)).toArray(byte[][]::new) : null);
+               long ret = bindings.EcdsaChannelSigner_sign_counterparty_commitment(this.ptr, commitment_tx.ptr, inbound_htlc_preimages != null ? Arrays.stream(inbound_htlc_preimages).map(inbound_htlc_preimages_conv_8 -> InternalUtils.check_arr_len(inbound_htlc_preimages_conv_8, 32)).toArray(byte[][]::new) : null, outbound_htlc_preimages != null ? Arrays.stream(outbound_htlc_preimages).map(outbound_htlc_preimages_conv_8 -> InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32)).toArray(byte[][]::new) : null);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(commitment_tx);
                Reference.reachabilityFence(inbound_htlc_preimages);
@@ -287,9 +328,16 @@ public class EcdsaChannelSigner extends CommonBase {
         * This may be called multiple times for the same transaction.
         * 
         * An external signer implementation should check that the commitment has not been revoked.
+        * 
+        * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+        * signature and should be retried later. Once the signer is ready to provide a signature after
+        * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+        * monitor.
+        * 
+        * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
         */
        public Result_ECDSASignatureNoneZ sign_holder_commitment(org.ldk.structs.HolderCommitmentTransaction commitment_tx) {
-               long ret = bindings.EcdsaChannelSigner_sign_holder_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr);
+               long ret = bindings.EcdsaChannelSigner_sign_holder_commitment(this.ptr, commitment_tx.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(commitment_tx);
                if (ret >= 0 && ret <= 4096) { return null; }
@@ -313,6 +361,13 @@ public class EcdsaChannelSigner extends CommonBase {
         * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
         * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
         * so).
+        * 
+        * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+        * signature and should be retried later. Once the signer is ready to provide a signature after
+        * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+        * monitor.
+        * 
+        * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
         */
        public Result_ECDSASignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) {
                long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32));
@@ -345,9 +400,16 @@ public class EcdsaChannelSigner extends CommonBase {
         * 
         * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
         * (which is committed to in the BIP 143 signatures).
+        * 
+        * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+        * signature and should be retried later. Once the signer is ready to provide a signature after
+        * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+        * monitor.
+        * 
+        * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
         */
        public Result_ECDSASignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, org.ldk.structs.HTLCOutputInCommitment htlc) {
-               long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32), htlc == null ? 0 : htlc.ptr);
+               long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32), htlc.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(justice_tx);
                Reference.reachabilityFence(input);
@@ -369,11 +431,17 @@ public class EcdsaChannelSigner extends CommonBase {
         * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
         * broadcasts it before receiving the update for the latest commitment transaction.
         * 
+        * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+        * signature and should be retried later. Once the signer is ready to provide a signature after
+        * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+        * monitor.
+        * 
         * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
         * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
+        * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
         */
        public Result_ECDSASignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, org.ldk.structs.HTLCDescriptor htlc_descriptor) {
-               long ret = bindings.EcdsaChannelSigner_sign_holder_htlc_transaction(this.ptr, htlc_tx, input, htlc_descriptor == null ? 0 : htlc_descriptor.ptr);
+               long ret = bindings.EcdsaChannelSigner_sign_holder_htlc_transaction(this.ptr, htlc_tx, input, htlc_descriptor.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(htlc_tx);
                Reference.reachabilityFence(input);
@@ -402,9 +470,16 @@ public class EcdsaChannelSigner extends CommonBase {
         * detected onchain. It has been generated by our counterparty and is used to derive
         * channel state keys, which are then included in the witness script and committed to in the
         * BIP 143 signature.
+        * 
+        * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+        * signature and should be retried later. Once the signer is ready to provide a signature after
+        * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+        * monitor.
+        * 
+        * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
         */
        public Result_ECDSASignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, org.ldk.structs.HTLCOutputInCommitment htlc) {
-               long ret = bindings.EcdsaChannelSigner_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc == null ? 0 : htlc.ptr);
+               long ret = bindings.EcdsaChannelSigner_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(htlc_tx);
                Reference.reachabilityFence(input);
@@ -424,7 +499,7 @@ public class EcdsaChannelSigner extends CommonBase {
         * chosen to forgo their output as dust.
         */
        public Result_ECDSASignatureNoneZ sign_closing_transaction(org.ldk.structs.ClosingTransaction closing_tx) {
-               long ret = bindings.EcdsaChannelSigner_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : closing_tx.ptr);
+               long ret = bindings.EcdsaChannelSigner_sign_closing_transaction(this.ptr, closing_tx.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(closing_tx);
                if (ret >= 0 && ret <= 4096) { return null; }
@@ -436,6 +511,13 @@ public class EcdsaChannelSigner extends CommonBase {
        /**
         * Computes the signature for a commitment transaction's anchor output used as an
         * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
+        * 
+        * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
+        * signature and should be retried later. Once the signer is ready to provide a signature after
+        * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
+        * monitor.
+        * 
+        * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
         */
        public Result_ECDSASignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input) {
                long ret = bindings.EcdsaChannelSigner_sign_holder_anchor_input(this.ptr, anchor_tx, input);
@@ -461,7 +543,7 @@ public class EcdsaChannelSigner extends CommonBase {
         * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message
         */
        public Result_ECDSASignatureNoneZ sign_channel_announcement_with_funding_key(org.ldk.structs.UnsignedChannelAnnouncement msg) {
-               long ret = bindings.EcdsaChannelSigner_sign_channel_announcement_with_funding_key(this.ptr, msg == null ? 0 : msg.ptr);
+               long ret = bindings.EcdsaChannelSigner_sign_channel_announcement_with_funding_key(this.ptr, msg.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(msg);
                if (ret >= 0 && ret <= 4096) { return null; }