X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FFundingSigned.cs;fp=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FFundingSigned.cs;h=e10f01ff17842bc9e7f6bc0602e95e51c3cd5e7a;hb=8de7213fbf663ff60322896282dad51e8ab2f001;hp=df6fb25e8d4b73f3aa2e49700d83ab499ed6dc81;hpb=afc50e5d491a11364849383b75a8f939df703bac;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/FundingSigned.cs b/c_sharp/src/org/ldk/structs/FundingSigned.cs index df6fb25e..e10f01ff 100644 --- a/c_sharp/src/org/ldk/structs/FundingSigned.cs +++ b/c_sharp/src/org/ldk/structs/FundingSigned.cs @@ -23,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); } @@ -41,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); } @@ -59,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; } @@ -107,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);