X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FOutPoint.cs;fp=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FOutPoint.cs;h=2d01d0a24cc9c02ab95d5f77cff1cbb846cd3e50;hb=8de7213fbf663ff60322896282dad51e8ab2f001;hp=c7187ff8ffec71f284ba19122c4ac2cd4ce05f71;hpb=afc50e5d491a11364849383b75a8f939df703bac;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/OutPoint.cs b/c_sharp/src/org/ldk/structs/OutPoint.cs index c7187ff8..2d01d0a2 100644 --- a/c_sharp/src/org/ldk/structs/OutPoint.cs +++ b/c_sharp/src/org/ldk/structs/OutPoint.cs @@ -22,16 +22,18 @@ public class OutPoint : CommonBase { * The referenced transaction's txid. */ public byte[] get_txid() { - byte[] ret = bindings.OutPoint_get_txid(this.ptr); + long ret = bindings.OutPoint_get_txid(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; } /** * The referenced transaction's txid. */ public void set_txid(byte[] val) { - bindings.OutPoint_set_txid(this.ptr, InternalUtils.check_arr_len(val, 32)); + bindings.OutPoint_set_txid(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); GC.KeepAlive(this); GC.KeepAlive(val); } @@ -58,7 +60,7 @@ public class OutPoint : CommonBase { * Constructs a new OutPoint given each field */ public static OutPoint of(byte[] txid_arg, short index_arg) { - long ret = bindings.OutPoint_new(InternalUtils.check_arr_len(txid_arg, 32), index_arg); + long ret = bindings.OutPoint_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(txid_arg, 32)), index_arg); GC.KeepAlive(txid_arg); GC.KeepAlive(index_arg); if (ret >= 0 && ret <= 4096) { return null; } @@ -118,25 +120,29 @@ public class OutPoint : CommonBase { * Convert an `OutPoint` to a lightning channel id. */ public byte[] to_channel_id() { - byte[] ret = bindings.OutPoint_to_channel_id(this.ptr); + long ret = bindings.OutPoint_to_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; } /** * Serialize the OutPoint object into a byte array which can be read by OutPoint_read */ public byte[] write() { - byte[] ret = bindings.OutPoint_write(this.ptr); + long ret = bindings.OutPoint_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 OutPoint from a byte array, created by OutPoint_write */ public static Result_OutPointDecodeErrorZ read(byte[] ser) { - long ret = bindings.OutPoint_read(ser); + long ret = bindings.OutPoint_read(InternalUtils.encodeUint8Array(ser)); GC.KeepAlive(ser); if (ret >= 0 && ret <= 4096) { return null; } Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);