aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/wallet_util.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-06-27 23:03:40 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-06-28 20:14:07 +0200
commitb57b633b942da162045b1fe7743a8abdfeaf60e2 (patch)
treebddde7c25becb24afe070ef0a80e6d0c58a4ac26 /test/functional/test_framework/wallet_util.py
parent61b6a017a9f99ef072b2d1980dd547eb20093352 (diff)
test: use script_util helpers for creating P2PKH scripts
Diffstat (limited to 'test/functional/test_framework/wallet_util.py')
-rwxr-xr-xtest/functional/test_framework/wallet_util.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/test_framework/wallet_util.py b/test/functional/test_framework/wallet_util.py
index d7ab720260..74a3e8c89c 100755
--- a/test/functional/test_framework/wallet_util.py
+++ b/test/functional/test_framework/wallet_util.py
@@ -21,14 +21,14 @@ from test_framework.script import (
OP_2,
OP_3,
OP_CHECKMULTISIG,
- OP_CHECKSIG,
- OP_DUP,
OP_EQUAL,
- OP_EQUALVERIFY,
OP_HASH160,
hash160,
sha256,
)
+from test_framework.script_util import (
+ key_to_p2pkh_script,
+)
from test_framework.util import hex_str_to_bytes
Key = namedtuple('Key', ['privkey',
@@ -60,7 +60,7 @@ def get_key(node):
pkh = hash160(hex_str_to_bytes(pubkey))
return Key(privkey=node.dumpprivkey(addr),
pubkey=pubkey,
- p2pkh_script=CScript([OP_DUP, OP_HASH160, pkh, OP_EQUALVERIFY, OP_CHECKSIG]).hex(),
+ p2pkh_script=key_to_p2pkh_script(pubkey).hex(),
p2pkh_addr=key_to_p2pkh(pubkey),
p2wpkh_script=CScript([OP_0, pkh]).hex(),
p2wpkh_addr=key_to_p2wpkh(pubkey),
@@ -79,7 +79,7 @@ def get_generate_key():
pkh = hash160(hex_str_to_bytes(pubkey))
return Key(privkey=privkey,
pubkey=pubkey,
- p2pkh_script=CScript([OP_DUP, OP_HASH160, pkh, OP_EQUALVERIFY, OP_CHECKSIG]).hex(),
+ p2pkh_script=key_to_p2pkh_script(pubkey).hex(),
p2pkh_addr=key_to_p2pkh(pubkey),
p2wpkh_script=CScript([OP_0, pkh]).hex(),
p2wpkh_addr=key_to_p2wpkh(pubkey),