aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/wallet_util.py
diff options
context:
space:
mode:
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),