X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FChannelUpdate.ts;h=c59b6116b45d0fc9fbb8d4bebb3e73105fca1199;hb=0fee03a8095f5599f8eccd920c1b1af6b3a20260;hp=9a8244da910bb8595ae8f5c7a5d2cff321b58e50;hpb=22f5f4208b1f3b5542292250f1612b944f5cd7fd;p=ldk-java diff --git a/ts/structs/ChannelUpdate.ts b/ts/structs/ChannelUpdate.ts index 9a8244da..c59b6116 100644 --- a/ts/structs/ChannelUpdate.ts +++ b/ts/structs/ChannelUpdate.ts @@ -18,36 +18,42 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ChannelUpdate_free(this.ptr); } } - public ChannelUpdate clone() { - number ret = bindings.ChannelUpdate_clone(this.ptr); - const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); - return ret_hu_conv; - } - public Uint8Array get_signature() { Uint8Array ret = bindings.ChannelUpdate_get_signature(this.ptr); return ret; } public void set_signature(Uint8Array val) { - bindings.ChannelUpdate_set_signature(this.ptr, val); + bindings.ChannelUpdate_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public UnsignedChannelUpdate get_contents() { number ret = bindings.ChannelUpdate_get_contents(this.ptr); const ret_hu_conv: UnsignedChannelUpdate = new UnsignedChannelUpdate(null, ret); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public void set_contents(UnsignedChannelUpdate val) { bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } public static ChannelUpdate constructor_new(Uint8Array signature_arg, UnsignedChannelUpdate contents_arg) { - number ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); + number ret = bindings.ChannelUpdate_new(InternalUtils.check_arr_len(signature_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1); + const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public number clone_ptr() { + number ret = bindings.ChannelUpdate_clone_ptr(this.ptr); + return ret; + } + + public ChannelUpdate clone() { + number ret = bindings.ChannelUpdate_clone(this.ptr); const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); - ret_hu_conv.ptrs_to.add(contents_arg); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -56,9 +62,9 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } - public static ChannelUpdate constructor_read(Uint8Array ser) { + public static Result_ChannelUpdateDecodeErrorZ constructor_read(Uint8Array ser) { number ret = bindings.ChannelUpdate_read(ser); - const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); + Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }