[C#] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / c_sharp / src / org / ldk / structs / EcdsaChannelSigner.cs
index c831afa8a6aad84001a076dae91323740d12455e..92f2a1ed99587487c5aec9a93141ef4ed5380a41 100644 (file)
@@ -35,6 +35,13 @@ public interface EcdsaChannelSignerInterface {
         * 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);
        /**Create a signature for the given input in a transaction spending an HTLC transaction output
@@ -51,6 +58,13 @@ public interface EcdsaChannelSignerInterface {
         * 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);
        /**Create a signature for the given input in a transaction spending a commitment transaction
@@ -71,6 +85,13 @@ public interface EcdsaChannelSignerInterface {
         * 
         * `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);
        /**Computes the signature for a commitment transaction's HTLC output used as an input within
@@ -81,8 +102,14 @@ public interface EcdsaChannelSignerInterface {
         * [`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);
        /**Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
@@ -102,6 +129,13 @@ public interface EcdsaChannelSignerInterface {
         * 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);
        /**Create a signature for a (proposed) closing transaction.
@@ -112,6 +146,13 @@ public interface EcdsaChannelSignerInterface {
        Result_ECDSASignatureNoneZ sign_closing_transaction(ClosingTransaction closing_tx);
        /**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);
        /**Signs a channel announcement message with our funding key proving it comes from one of the
@@ -172,14 +213,14 @@ public class EcdsaChannelSigner : CommonBase {
                        bindings.free_buffer(_outbound_htlc_preimages);
                        Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ ret = arg.sign_counterparty_commitment(_commitment_tx_hu_conv, _inbound_htlc_preimages_conv_8_arr, _outbound_htlc_preimages_conv_8_arr);
                                GC.KeepAlive(arg);
-                       long result = ret == null ? 0 : ret.clone_ptr();
+                       long result = ret.clone_ptr();
                        return result;
                }
                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);
                                GC.KeepAlive(arg);
-                       long result = ret == null ? 0 : ret.clone_ptr();
+                       long result = ret.clone_ptr();
                        return result;
                }
                public long sign_justice_revoked_output(long _justice_tx, long _input, long _amount, long _per_commitment_key) {
@@ -187,7 +228,7 @@ public class EcdsaChannelSigner : CommonBase {
                        byte[] _per_commitment_key_conv = InternalUtils.decodeUint8Array(_per_commitment_key);
                        Result_ECDSASignatureNoneZ ret = arg.sign_justice_revoked_output(_justice_tx_conv, _input, _amount, _per_commitment_key_conv);
                                GC.KeepAlive(arg);
-                       long result = ret == null ? 0 : ret.clone_ptr();
+                       long result = ret.clone_ptr();
                        return result;
                }
                public long sign_justice_revoked_htlc(long _justice_tx, long _input, long _amount, long _per_commitment_key, long _htlc) {
@@ -196,7 +237,7 @@ public class EcdsaChannelSigner : CommonBase {
                        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_conv, _input, _amount, _per_commitment_key_conv, _htlc_hu_conv);
                                GC.KeepAlive(arg);
-                       long result = ret == null ? 0 : ret.clone_ptr();
+                       long result = ret.clone_ptr();
                        return result;
                }
                public long sign_holder_htlc_transaction(long _htlc_tx, long _input, long _htlc_descriptor) {
@@ -204,7 +245,7 @@ public class EcdsaChannelSigner : CommonBase {
                        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_conv, _input, _htlc_descriptor_hu_conv);
                                GC.KeepAlive(arg);
-                       long result = ret == null ? 0 : ret.clone_ptr();
+                       long result = ret.clone_ptr();
                        return result;
                }
                public long sign_counterparty_htlc_transaction(long _htlc_tx, long _input, long _amount, long _per_commitment_point, long _htlc) {
@@ -213,28 +254,28 @@ public class EcdsaChannelSigner : CommonBase {
                        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_conv, _input, _amount, _per_commitment_point_conv, _htlc_hu_conv);
                                GC.KeepAlive(arg);
-                       long result = ret == null ? 0 : ret.clone_ptr();
+                       long result = ret.clone_ptr();
                        return result;
                }
                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);
                                GC.KeepAlive(arg);
-                       long result = ret == null ? 0 : ret.clone_ptr();
+                       long result = ret.clone_ptr();
                        return result;
                }
                public long sign_holder_anchor_input(long _anchor_tx, long _input) {
                        byte[] _anchor_tx_conv = InternalUtils.decodeUint8Array(_anchor_tx);
                        Result_ECDSASignatureNoneZ ret = arg.sign_holder_anchor_input(_anchor_tx_conv, _input);
                                GC.KeepAlive(arg);
-                       long result = ret == null ? 0 : ret.clone_ptr();
+                       long result = ret.clone_ptr();
                        return result;
                }
                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);
                                GC.KeepAlive(arg);
-                       long result = ret == null ? 0 : ret.clone_ptr();
+                       long result = ret.clone_ptr();
                        return result;
                }
        }
@@ -244,7 +285,7 @@ public class EcdsaChannelSigner : CommonBase {
                LDKEcdsaChannelSignerHolder impl_holder = new LDKEcdsaChannelSignerHolder();
                LDKEcdsaChannelSignerImpl impl = new LDKEcdsaChannelSignerImpl(arg, impl_holder);
                ChannelSigner channelSigner = ChannelSigner.new_impl(channelSigner_impl, pubkeys);
-               long[] ptr_idx = bindings.LDKEcdsaChannelSigner_new(impl, channelSigner.instance_idx, pubkeys == null ? 0 : pubkeys.clone_ptr());
+               long[] ptr_idx = bindings.LDKEcdsaChannelSigner_new(impl, channelSigner.instance_idx, pubkeys.clone_ptr());
 
                impl_holder.held = new EcdsaChannelSigner(null, ptr_idx[0]);
                impl_holder.held.instance_idx = ptr_idx[1];
@@ -270,7 +311,7 @@ public class EcdsaChannelSigner : 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, InternalUtils.encodeUint64Array(InternalUtils.mapArray(inbound_htlc_preimages, inbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(inbound_htlc_preimages_conv_8, 32)))), InternalUtils.encodeUint64Array(InternalUtils.mapArray(outbound_htlc_preimages, outbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32)))));
+               long ret = bindings.EcdsaChannelSigner_sign_counterparty_commitment(this.ptr, commitment_tx.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(inbound_htlc_preimages, inbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(inbound_htlc_preimages_conv_8, 32)))), InternalUtils.encodeUint64Array(InternalUtils.mapArray(outbound_htlc_preimages, outbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32)))));
                GC.KeepAlive(this);
                GC.KeepAlive(commitment_tx);
                GC.KeepAlive(inbound_htlc_preimages);
@@ -291,9 +332,16 @@ public class EcdsaChannelSigner : 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);
                GC.KeepAlive(this);
                GC.KeepAlive(commitment_tx);
                if (ret >= 0 && ret <= 4096) { return null; }
@@ -317,6 +365,13 @@ public class EcdsaChannelSigner : 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, InternalUtils.encodeUint8Array(justice_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_key, 32)));
@@ -349,9 +404,16 @@ public class EcdsaChannelSigner : 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, InternalUtils.encodeUint8Array(justice_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_key, 32)), htlc == null ? 0 : htlc.ptr);
+               long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_htlc(this.ptr, InternalUtils.encodeUint8Array(justice_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_key, 32)), htlc.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(justice_tx);
                GC.KeepAlive(input);
@@ -373,11 +435,17 @@ public class EcdsaChannelSigner : 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, InternalUtils.encodeUint8Array(htlc_tx), input, htlc_descriptor == null ? 0 : htlc_descriptor.ptr);
+               long ret = bindings.EcdsaChannelSigner_sign_holder_htlc_transaction(this.ptr, InternalUtils.encodeUint8Array(htlc_tx), input, htlc_descriptor.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(htlc_tx);
                GC.KeepAlive(input);
@@ -406,9 +474,16 @@ public class EcdsaChannelSigner : 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, InternalUtils.encodeUint8Array(htlc_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)), htlc == null ? 0 : htlc.ptr);
+               long ret = bindings.EcdsaChannelSigner_sign_counterparty_htlc_transaction(this.ptr, InternalUtils.encodeUint8Array(htlc_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)), htlc.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(htlc_tx);
                GC.KeepAlive(input);
@@ -428,7 +503,7 @@ public class EcdsaChannelSigner : 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);
                GC.KeepAlive(this);
                GC.KeepAlive(closing_tx);
                if (ret >= 0 && ret <= 4096) { return null; }
@@ -440,6 +515,13 @@ public class EcdsaChannelSigner : 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, InternalUtils.encodeUint8Array(anchor_tx), input);
@@ -465,7 +547,7 @@ public class EcdsaChannelSigner : 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);
                GC.KeepAlive(this);
                GC.KeepAlive(msg);
                if (ret >= 0 && ret <= 4096) { return null; }