test: add helpers for creating P2TR scripts/addresses from output key

This commit is contained in:
Sebastian Falbesoner committed 2022-06-14 13:32:57 +02:00
1 parent 9e4fbebcc8
commit 1999dcfa40
3 files changed
+12 -8

No files matched your search

@@ -105,6 +105,11 @@ def script_to_p2sh_p2wsh_script(script):
return script_to_p2sh_script(p2shscript)
def output_key_to_p2tr_script(key):
assert len(key) == 32
return program_to_witness_script(1, key)
def check_key(key):
if isinstance(key, str):
key = bytes.fromhex(key) # Assuming this is hex string