diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-09-28 15:48:05 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-09-28 15:46:57 +0200 |
commit | fa4676805910bfea5549f5b51460c8456bc8945c (patch) | |
tree | d97bd2c8c3e8418f882e60b25a1dbd9284d4fb37 | |
parent | a9d0cec4991ab057557af9992daa4c8146a9b9d0 (diff) | |
download | bitcoin-fa4676805910bfea5549f5b51460c8456bc8945c.tar.xz |
test: Remove unused and confusing main parameter from script_util
Bitcoin script opcodes are equal on all chains (main and test) anyway.
Can be reviewed with "--word-diff-regex=.".
-rwxr-xr-x | test/functional/test_framework/script_util.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/functional/test_framework/script_util.py b/test/functional/test_framework/script_util.py index 5d1d7ea45c..30631f3671 100755 --- a/test/functional/test_framework/script_util.py +++ b/test/functional/test_framework/script_util.py @@ -25,28 +25,28 @@ from test_framework.script import CScript, hash160, sha256, OP_0, OP_DUP, OP_HAS DUMMY_P2WPKH_SCRIPT = CScript([b'a' * 21]) DUMMY_2_P2WPKH_SCRIPT = CScript([b'b' * 21]) -def keyhash_to_p2pkh_script(hash, main = False): +def keyhash_to_p2pkh_script(hash): assert len(hash) == 20 return CScript([OP_DUP, OP_HASH160, hash, OP_EQUALVERIFY, OP_CHECKSIG]) -def scripthash_to_p2sh_script(hash, main = False): +def scripthash_to_p2sh_script(hash): assert len(hash) == 20 return CScript([OP_HASH160, hash, OP_EQUAL]) -def key_to_p2pkh_script(key, main = False): +def key_to_p2pkh_script(key): key = check_key(key) - return keyhash_to_p2pkh_script(hash160(key), main) + return keyhash_to_p2pkh_script(hash160(key)) -def script_to_p2sh_script(script, main = False): +def script_to_p2sh_script(script): script = check_script(script) - return scripthash_to_p2sh_script(hash160(script), main) + return scripthash_to_p2sh_script(hash160(script)) -def key_to_p2sh_p2wpkh_script(key, main = False): +def key_to_p2sh_p2wpkh_script(key): key = check_key(key) p2shscript = CScript([OP_0, hash160(key)]) - return script_to_p2sh_script(p2shscript, main) + return script_to_p2sh_script(p2shscript) -def program_to_witness_script(version, program, main = False): +def program_to_witness_script(version, program): if isinstance(program, str): program = bytes.fromhex(program) assert 0 <= version <= 16 @@ -54,18 +54,18 @@ def program_to_witness_script(version, program, main = False): assert version > 0 or len(program) in [20, 32] return CScript([version, program]) -def script_to_p2wsh_script(script, main = False): +def script_to_p2wsh_script(script): script = check_script(script) - return program_to_witness_script(0, sha256(script), main) + return program_to_witness_script(0, sha256(script)) -def key_to_p2wpkh_script(key, main = False): +def key_to_p2wpkh_script(key): key = check_key(key) - return program_to_witness_script(0, hash160(key), main) + return program_to_witness_script(0, hash160(key)) -def script_to_p2sh_p2wsh_script(script, main = False): +def script_to_p2sh_p2wsh_script(script): script = check_script(script) p2shscript = CScript([OP_0, sha256(script)]) - return script_to_p2sh_script(p2shscript, main) + return script_to_p2sh_script(p2shscript) def check_key(key): if isinstance(key, str): |