X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FTxAddOutput.cs;h=be541edbcd41d917d83a95a73009f7e54b540614;hb=8de7213fbf663ff60322896282dad51e8ab2f001;hp=7b31d9e145c7c6d788a579c9007372c6f33a09d6;hpb=afc50e5d491a11364849383b75a8f939df703bac;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/TxAddOutput.cs b/c_sharp/src/org/ldk/structs/TxAddOutput.cs index 7b31d9e1..be541edb 100644 --- a/c_sharp/src/org/ldk/structs/TxAddOutput.cs +++ b/c_sharp/src/org/ldk/structs/TxAddOutput.cs @@ -19,16 +19,18 @@ public class TxAddOutput : CommonBase { * The channel ID */ public byte[] get_channel_id() { - byte[] ret = bindings.TxAddOutput_get_channel_id(this.ptr); + long ret = bindings.TxAddOutput_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.TxAddOutput_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + bindings.TxAddOutput_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); GC.KeepAlive(this); GC.KeepAlive(val); } @@ -75,16 +77,18 @@ public class TxAddOutput : CommonBase { * The scriptPubKey for the output */ public byte[] get_script() { - byte[] ret = bindings.TxAddOutput_get_script(this.ptr); + long ret = bindings.TxAddOutput_get_script(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; } /** * The scriptPubKey for the output */ public void set_script(byte[] val) { - bindings.TxAddOutput_set_script(this.ptr, val); + bindings.TxAddOutput_set_script(this.ptr, InternalUtils.encodeUint8Array(val)); GC.KeepAlive(this); GC.KeepAlive(val); } @@ -93,7 +97,7 @@ public class TxAddOutput : CommonBase { * Constructs a new TxAddOutput given each field */ public static TxAddOutput of(byte[] channel_id_arg, long serial_id_arg, long sats_arg, byte[] script_arg) { - long ret = bindings.TxAddOutput_new(InternalUtils.check_arr_len(channel_id_arg, 32), serial_id_arg, sats_arg, script_arg); + long ret = bindings.TxAddOutput_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), serial_id_arg, sats_arg, InternalUtils.encodeUint8Array(script_arg)); GC.KeepAlive(channel_id_arg); GC.KeepAlive(serial_id_arg); GC.KeepAlive(sats_arg); @@ -143,16 +147,18 @@ public class TxAddOutput : CommonBase { * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read */ public byte[] write() { - byte[] ret = bindings.TxAddOutput_write(this.ptr); + long ret = bindings.TxAddOutput_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 TxAddOutput from a byte array, created by TxAddOutput_write */ public static Result_TxAddOutputDecodeErrorZ read(byte[] ser) { - long ret = bindings.TxAddOutput_read(ser); + long ret = bindings.TxAddOutput_read(InternalUtils.encodeUint8Array(ser)); GC.KeepAlive(ser); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret);