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

This commit is contained in:
Sebastian Falbesoner
2022-06-07 01:42:58 +02:00
parent 9e4fbebcc8
commit 1999dcfa40
3 changed files with 12 additions and 8 deletions

View File

@@ -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