MCPcopy Create free account
hub / github.com/ElementsProject/elements / run_test

Method run_test

test/functional/wallet_keypool.py:20–205  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18 self.skip_if_no_wallet()
19
20 def run_test(self):
21 nodes = self.nodes
22 addr_before_encrypting = nodes[0].getnewaddress()
23 addr_before_encrypting_data = nodes[0].getaddressinfo(addr_before_encrypting)
24 wallet_info_old = nodes[0].getwalletinfo()
25 if not self.options.descriptors:
26 assert addr_before_encrypting_data['hdseedid'] == wallet_info_old['hdseedid']
27
28 # Encrypt wallet and wait to terminate
29 nodes[0].encryptwallet('test')
30 if self.options.descriptors:
31 # Import hardened derivation only descriptors
32 nodes[0].walletpassphrase('test', 10)
33 nodes[0].importdescriptors([
34 {
35 "desc": "wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0h/*h)#y4dfsj7n",
36 "timestamp": "now",
37 "range": [0,0],
38 "active": True
39 },
40 {
41 "desc": "pkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1h/*h)#a0nyvl0k",
42 "timestamp": "now",
43 "range": [0,0],
44 "active": True
45 },
46 {
47 "desc": "sh(wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/2h/*h))#lmeu2axg",
48 "timestamp": "now",
49 "range": [0,0],
50 "active": True
51 },
52 {
53 "desc": "wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/3h/*h)#jkl636gm",
54 "timestamp": "now",
55 "range": [0,0],
56 "active": True,
57 "internal": True
58 },
59 {
60 "desc": "pkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/4h/*h)#l3crwaus",
61 "timestamp": "now",
62 "range": [0,0],
63 "active": True,
64 "internal": True
65 },
66 {
67 "desc": "sh(wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/5h/*h))#qg8wa75f",
68 "timestamp": "now",
69 "range": [0,0],
70 "active": True,
71 "internal": True
72 }
73 ])
74 nodes[0].walletlock()
75 # Keep creating keys
76 addr = nodes[0].getnewaddress()
77 addr_data = nodes[0].getaddressinfo(addr)

Callers

nothing calls this directly

Calls 6

assert_raises_rpc_errorFunction · 0.90
assert_equalFunction · 0.90
createwalletMethod · 0.80
addMethod · 0.45
get_wallet_rpcMethod · 0.45
generateMethod · 0.45

Tested by

no test coverage detected