[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / FundingSigned.cs
index a0badf5998a62586be6cdc7c9a60d47a6b5a4dd9..e10f01ff17842bc9e7f6bc0602e95e51c3cd5e7a 100644 (file)
@@ -7,7 +7,11 @@ namespace org { namespace ldk { namespace structs {
 
 
 /**
- * A funding_signed message to be sent or received from a peer
+ * A [`funding_signed`] message to be sent to or received from a peer.
+ * 
+ * Used in V1 channel establishment
+ * 
+ * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
  */
 public class FundingSigned : CommonBase {
        internal FundingSigned(object _dummy, long ptr) : base(ptr) { }
@@ -19,16 +23,18 @@ public class FundingSigned : CommonBase {
         * The channel ID
         */
        public byte[] get_channel_id() {
-               byte[] ret = bindings.FundingSigned_get_channel_id(this.ptr);
+               long ret = bindings.FundingSigned_get_channel_id(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        /**
         * The channel ID
         */
        public void set_channel_id(byte[] val) {
-               bindings.FundingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+               bindings.FundingSigned_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
                GC.KeepAlive(this);
                GC.KeepAlive(val);
        }
@@ -37,16 +43,18 @@ public class FundingSigned : CommonBase {
         * The signature of the channel acceptor (fundee) on the initial commitment transaction
         */
        public byte[] get_signature() {
-               byte[] ret = bindings.FundingSigned_get_signature(this.ptr);
+               long ret = bindings.FundingSigned_get_signature(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        /**
         * The signature of the channel acceptor (fundee) on the initial commitment transaction
         */
        public void set_signature(byte[] val) {
-               bindings.FundingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+               bindings.FundingSigned_set_signature(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 64)));
                GC.KeepAlive(this);
                GC.KeepAlive(val);
        }
@@ -55,7 +63,7 @@ public class FundingSigned : CommonBase {
         * Constructs a new FundingSigned given each field
         */
        public static FundingSigned of(byte[] channel_id_arg, byte[] signature_arg) {
-               long ret = bindings.FundingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64));
+               long ret = bindings.FundingSigned_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)));
                GC.KeepAlive(channel_id_arg);
                GC.KeepAlive(signature_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
@@ -103,16 +111,18 @@ public class FundingSigned : CommonBase {
         * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
         */
        public byte[] write() {
-               byte[] ret = bindings.FundingSigned_write(this.ptr);
+               long ret = bindings.FundingSigned_write(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        /**
         * Read a FundingSigned from a byte array, created by FundingSigned_write
         */
        public static Result_FundingSignedDecodeErrorZ read(byte[] ser) {
-               long ret = bindings.FundingSigned_read(ser);
+               long ret = bindings.FundingSigned_read(InternalUtils.encodeUint8Array(ser));
                GC.KeepAlive(ser);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);