X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FShutdownScript.ts;h=e1da61d7b230afeab62f4830e2dad0cba9c10752;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=c035f7c9fc46d47cd4bc82d569dd40ec8cc5f024;hpb=e30b350e325e7d517ea744578876d473839ad495;p=ldk-java diff --git a/ts/structs/ShutdownScript.ts b/ts/structs/ShutdownScript.ts index c035f7c9..e1da61d7 100644 --- a/ts/structs/ShutdownScript.ts +++ b/ts/structs/ShutdownScript.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ShutdownScript_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.ShutdownScript_clone_ptr(this.ptr); + return ret; + } + public ShutdownScript clone() { number ret = bindings.ShutdownScript_clone(this.ptr); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); @@ -37,14 +42,14 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ShutdownScript constructor_new_p2wpkh(Uint8Array pubkey_hash) { - number ret = bindings.ShutdownScript_new_p2wpkh(pubkey_hash); + number ret = bindings.ShutdownScript_new_p2wpkh(InternalUtils.check_arr_len(pubkey_hash, 20)); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static ShutdownScript constructor_new_p2wsh(Uint8Array script_hash) { - number ret = bindings.ShutdownScript_new_p2wsh(script_hash); + number ret = bindings.ShutdownScript_new_p2wsh(InternalUtils.check_arr_len(script_hash, 32)); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv;