diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-10-18 22:25:04 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-10-26 14:51:18 +0200 |
commit | 4718897ce3a7c728ff7aebbadabcc8ed7a0b8d6e (patch) | |
tree | 94688adb3b3e52d5d0c202e960521d49ce680aff /test/functional/test_framework/wallet_util.py | |
parent | 22a90186496aea8025316bc5616905ffcf1aeb29 (diff) |
test: add script_util helper for creating bare multisig scripts
Diffstat (limited to 'test/functional/test_framework/wallet_util.py')
-rwxr-xr-x | test/functional/test_framework/wallet_util.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/test/functional/test_framework/wallet_util.py b/test/functional/test_framework/wallet_util.py index 1ee55aa3b7..c307ded542 100755 --- a/test/functional/test_framework/wallet_util.py +++ b/test/functional/test_framework/wallet_util.py @@ -15,15 +15,10 @@ from test_framework.address import ( script_to_p2wsh, ) from test_framework.key import ECKey -from test_framework.script import ( - CScript, - OP_2, - OP_3, - OP_CHECKMULTISIG, -) from test_framework.script_util import ( key_to_p2pkh_script, key_to_p2wpkh_script, + keys_to_multisig_script, script_to_p2sh_script, script_to_p2wsh_script, ) @@ -92,7 +87,7 @@ def get_multisig(node): addr = node.getaddressinfo(node.getnewaddress()) addrs.append(addr['address']) pubkeys.append(addr['pubkey']) - script_code = CScript([OP_2] + [bytes.fromhex(pubkey) for pubkey in pubkeys] + [OP_3, OP_CHECKMULTISIG]) + script_code = keys_to_multisig_script(pubkeys, k=2) witness_script = script_to_p2wsh_script(script_code) return Multisig(privkeys=[node.dumpprivkey(addr) for addr in addrs], pubkeys=pubkeys, |