X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FHTLCOutputInCommitment.ts;h=3b93a6a7b18948d67db31385ad50496974d84c23;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=2f0e42b11c722970c961b7a5d39ad2da8bbf6d7d;hpb=e30b350e325e7d517ea744578876d473839ad495;p=ldk-java diff --git a/ts/structs/HTLCOutputInCommitment.ts b/ts/structs/HTLCOutputInCommitment.ts index 2f0e42b1..3b93a6a7 100644 --- a/ts/structs/HTLCOutputInCommitment.ts +++ b/ts/structs/HTLCOutputInCommitment.ts @@ -51,7 +51,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_payment_hash(Uint8Array val) { - bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val); + bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Option_u32Z get_transaction_output_index() { @@ -66,12 +66,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static HTLCOutputInCommitment constructor_new(boolean offered_arg, number amount_msat_arg, number cltv_expiry_arg, Uint8Array payment_hash_arg, Option_u32Z transaction_output_index_arg) { - number ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg, transaction_output_index_arg.ptr); + number ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, InternalUtils.check_arr_len(payment_hash_arg, 32), transaction_output_index_arg.ptr); const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.HTLCOutputInCommitment_clone_ptr(this.ptr); + return ret; + } + public HTLCOutputInCommitment clone() { number ret = bindings.HTLCOutputInCommitment_clone(this.ptr); const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret);