Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/wallet_util.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2018 The Bitcoin Core developers | # Copyright (c) 2018 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Useful util functions for testing the wallet""" | """Useful util functions for testing the wallet""" | ||||
from collections import namedtuple | from collections import namedtuple | ||||
from test_framework.address import ( | from test_framework.address import byte_to_base58, key_to_p2pkh, script_to_p2sh | ||||
byte_to_base58, | |||||
key_to_p2pkh, | |||||
script_to_p2sh, | |||||
) | |||||
from test_framework.key import ECKey | from test_framework.key import ECKey | ||||
from test_framework.script import ( | from test_framework.script import ( | ||||
CScript, | |||||
OP_2, | OP_2, | ||||
OP_3, | OP_3, | ||||
OP_CHECKMULTISIG, | OP_CHECKMULTISIG, | ||||
OP_CHECKSIG, | OP_CHECKSIG, | ||||
OP_DUP, | OP_DUP, | ||||
OP_EQUAL, | OP_EQUAL, | ||||
OP_EQUALVERIFY, | OP_EQUALVERIFY, | ||||
OP_HASH160, | OP_HASH160, | ||||
CScript, | |||||
hash160, | hash160, | ||||
) | ) | ||||
from test_framework.util import hex_str_to_bytes | from test_framework.util import hex_str_to_bytes | ||||
Key = namedtuple('Key', ['privkey', | Key = namedtuple('Key', ['privkey', | ||||
'pubkey', | 'pubkey', | ||||
'p2pkh_script', | 'p2pkh_script', | ||||
'p2pkh_addr']) | 'p2pkh_addr']) | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |