aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2024-06-11 02:13:18 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2024-06-11 18:53:07 +0200
commit3162c917e93fde4bea6e4627bb0c3c7cdc37386c (patch)
treea46f90cdeb94118ffa6200ecfb47c2994d163748 /test/functional/test_framework
parentc9f7364ab2bccad56a4473dbd18d9c80eaf651d4 (diff)
test: fix MiniWallet internal key derivation for tagged instances
Not every pseudorandom hash result is a valid x-only public key, so the pubkey tweaking in the course of creating the output public key would fail about every second time. Fix this by treating the hash result as private key and calculate the x-only public key out of that, to be used then as internal key.
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r--test/functional/test_framework/wallet.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py
index e816f6fedd..0d37b7ffb5 100644
--- a/test/functional/test_framework/wallet.py
+++ b/test/functional/test_framework/wallet.py
@@ -105,7 +105,7 @@ class MiniWallet:
pub_key = self._priv_key.get_pubkey()
self._scriptPubKey = key_to_p2pk_script(pub_key.get_bytes())
elif mode == MiniWalletMode.ADDRESS_OP_TRUE:
- internal_key = None if tag_name is None else hash256(tag_name.encode())
+ internal_key = None if tag_name is None else compute_xonly_pubkey(hash256(tag_name.encode()))[0]
self._address, self._taproot_info = create_deterministic_address_bcrt1_p2tr_op_true(internal_key)
self._scriptPubKey = address_to_scriptpubkey(self._address)