X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FClosingSigned.ts;h=c9cd256422a3bedeeff57ca3838adbab9ce7d302;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=8be14a855041897056ec89f329e7a8d99c233fc2;hpb=e30b350e325e7d517ea744578876d473839ad495;p=ldk-java diff --git a/ts/structs/ClosingSigned.ts b/ts/structs/ClosingSigned.ts index 8be14a85..c9cd2564 100644 --- a/ts/structs/ClosingSigned.ts +++ b/ts/structs/ClosingSigned.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.ClosingSigned_set_channel_id(this.ptr, val); + bindings.ClosingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_fee_satoshis() { @@ -42,7 +42,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_signature(Uint8Array val) { - bindings.ClosingSigned_set_signature(this.ptr, val); + bindings.ClosingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public ClosingSignedFeeRange get_fee_range() { @@ -57,12 +57,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ClosingSigned constructor_new(Uint8Array channel_id_arg, number fee_satoshis_arg, Uint8Array signature_arg, ClosingSignedFeeRange fee_range_arg) { - number ret = bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg, fee_range_arg == null ? 0 : fee_range_arg.ptr & ~1); + number ret = bindings.ClosingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), fee_satoshis_arg, InternalUtils.check_arr_len(signature_arg, 64), fee_range_arg == null ? 0 : fee_range_arg.ptr & ~1); const ret_hu_conv: ClosingSigned = new ClosingSigned(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ClosingSigned_clone_ptr(this.ptr); + return ret; + } + public ClosingSigned clone() { number ret = bindings.ClosingSigned_clone(this.ptr); const ret_hu_conv: ClosingSigned = new ClosingSigned(null, ret);