You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Distributed under the MIT software license, see the accompanying
4
+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
+
"""Useful util functions for testing the wallet"""
6
+
fromcollectionsimportnamedtuple
7
+
8
+
fromtest_framework.addressimport (
9
+
key_to_p2pkh,
10
+
key_to_p2sh_p2wpkh,
11
+
key_to_p2wpkh,
12
+
script_to_p2sh,
13
+
script_to_p2sh_p2wsh,
14
+
script_to_p2wsh,
15
+
)
16
+
fromtest_framework.scriptimport (
17
+
CScript,
18
+
OP_0,
19
+
OP_2,
20
+
OP_3,
21
+
OP_CHECKMULTISIG,
22
+
OP_CHECKSIG,
23
+
OP_DUP,
24
+
OP_EQUAL,
25
+
OP_EQUALVERIFY,
26
+
OP_HASH160,
27
+
hash160,
28
+
sha256,
29
+
)
30
+
fromtest_framework.utilimporthex_str_to_bytes
31
+
32
+
Key=namedtuple('Key', ['privkey',
33
+
'pubkey',
34
+
'p2pkh_script',
35
+
'p2pkh_addr',
36
+
'p2wpkh_script',
37
+
'p2wpkh_addr',
38
+
'p2sh_p2wpkh_script',
39
+
'p2sh_p2wpkh_redeem_script',
40
+
'p2sh_p2wpkh_addr'])
41
+
42
+
Multisig=namedtuple('Multisig', ['privkeys',
43
+
'pubkeys',
44
+
'p2sh_script',
45
+
'p2sh_addr',
46
+
'redeem_script',
47
+
'p2wsh_script',
48
+
'p2wsh_addr',
49
+
'p2sh_p2wsh_script',
50
+
'p2sh_p2wsh_addr'])
51
+
52
+
defget_key(node):
53
+
"""Generate a fresh key on node
54
+
55
+
Returns a named tuple of privkey, pubkey and all address and scripts."""
0 commit comments