mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
test: add MiniWallet tagging support to avoid UTXO mixing
Note that this commit doesn't change behaviour yet, as tagging isn't used in any MiniWallet instance.
This commit is contained in:
@@ -47,7 +47,7 @@ class AddressType(enum.Enum):
|
||||
b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
|
||||
|
||||
|
||||
def create_deterministic_address_bcrt1_p2tr_op_true():
|
||||
def create_deterministic_address_bcrt1_p2tr_op_true(explicit_internal_key=None):
|
||||
"""
|
||||
Generates a deterministic bech32m address (segwit v1 output) that
|
||||
can be spent with a witness stack of OP_TRUE and the control block
|
||||
@@ -55,9 +55,10 @@ def create_deterministic_address_bcrt1_p2tr_op_true():
|
||||
|
||||
Returns a tuple with the generated address and the internal key.
|
||||
"""
|
||||
internal_key = (1).to_bytes(32, 'big')
|
||||
internal_key = explicit_internal_key or (1).to_bytes(32, 'big')
|
||||
address = output_key_to_p2tr(taproot_construct(internal_key, [(None, CScript([OP_TRUE]))]).output_pubkey)
|
||||
assert_equal(address, 'bcrt1p9yfmy5h72durp7zrhlw9lf7jpwjgvwdg0jr0lqmmjtgg83266lqsekaqka')
|
||||
if explicit_internal_key is None:
|
||||
assert_equal(address, 'bcrt1p9yfmy5h72durp7zrhlw9lf7jpwjgvwdg0jr0lqmmjtgg83266lqsekaqka')
|
||||
return (address, internal_key)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user