Skip to content

Commit efb11d7

Browse files
author
MarcoFalke
committed
Merge #14179: qa: Fixups to "Run all tests even if wallet is not compiled"
fa8433e qa: Remove unneded import_deterministic_coinbase_privkeys overwrite, add comments (MarcoFalke) e413c2d qa: Fix codespell error and have lint-spelling error instead of warn (MarcoFalke) Pull request description: Currently the functional tests require the wallet module to be compiled into the Bitcoin Core executable. For example the premine (or datadir cache) to speed up tests when run in parallel would mine a bunch of blocks and store the private keys to sign the coinbase tx outputs in a wallet. There is no need to have the overhead of the whole wallet module by using keys that are deterministic for all runs. Note that this change most likely requires the `./test/cache/` to be cleared. Tree-SHA512: 9ce26036b0e10f0f888f66a1e50be6a357343f9ffb302ae24a7bb3df2f083a31702ef308b738a03b08a1b623aeddac5d6563dc1b15078c0357b7dafad7808ec3
2 parents f0a6a92 + fa8433e commit efb11d7

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

test/functional/interface_zmq.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ def skip_test_if_missing_module(self):
4444
self.skip_if_no_wallet()
4545

4646
def setup_nodes(self):
47-
# Import keys
48-
self.add_nodes(self.num_nodes)
49-
self.start_nodes()
50-
super().import_deterministic_coinbase_privkeys()
51-
self.stop_nodes()
52-
5347
import zmq
5448

5549
# Initialize ZMQ context and socket.
@@ -69,12 +63,13 @@ def setup_nodes(self):
6963
self.rawblock = ZMQSubscriber(socket, b"rawblock")
7064
self.rawtx = ZMQSubscriber(socket, b"rawtx")
7165

72-
self.nodes[0].extra_args = ["-zmqpub%s=%s" % (sub.topic.decode(), address) for sub in [self.hashblock, self.hashtx, self.rawblock, self.rawtx]]
66+
self.extra_args = [
67+
["-zmqpub%s=%s" % (sub.topic.decode(), address) for sub in [self.hashblock, self.hashtx, self.rawblock, self.rawtx]],
68+
[],
69+
]
70+
self.add_nodes(self.num_nodes, self.extra_args)
7371
self.start_nodes()
7472

75-
def import_deterministic_coinbase_privkeys(self):
76-
pass
77-
7873
def run_test(self):
7974
try:
8075
self._zmq_test()

test/functional/test_framework/test_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def __init__(self, i, datadir, *, rpchost, timewait, bitcoind, bitcoin_cli, mock
100100
def get_deterministic_priv_key(self):
101101
"""Return a deterministic priv key in base58, that only depends on the node's index"""
102102
PRIV_KEYS = [
103-
# adress , privkey
103+
# address , privkey
104104
('mjTkW3DjgyZck4KbiRusZsqTgaYTxdSz6z', 'cVpF924EspNh8KjYsfhgY96mmxvT6DgdWiTYMtMjuM74hJaU5psW'),
105105
('msX6jQXvxiNhx3Q62PKeLPrhrqZQdSimTg', 'cUxsWyKyZ9MAQTaAhUQWJmBbSvHMwSmuv59KgxQV7oZQU3PXN3KE'),
106106
('mnonCMyH9TmAsSj3M59DsbH8H63U3RKoFP', 'cTrh7dkEAeJd6b3MRX9bZK8eRmNqVCMH3LSUkE3dSFDyzjU38QxK'),

test/functional/wallet_dump.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ def read_dump(file_name, addrs, script_addrs, hd_master_addr_old):
3434
# key = key_date_label[0]
3535
date = key_date_label[1]
3636
keytype = key_date_label[2]
37-
if not len(comment) or date.startswith('1970'):
37+
38+
imported_key = date == '1970-01-01T00:00:01Z'
39+
if imported_key:
40+
# Imported keys have multiple addresses, no label (keypath) and timestamp
41+
# Skip them
3842
continue
3943

4044
addr_keypath = comment.split(" addr=")[1]

test/functional/wallet_import_rescan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def setup_network(self):
120120

121121
self.add_nodes(self.num_nodes, extra_args=extra_args)
122122

123-
# Import keys
123+
# Import keys with pruning disabled
124124
self.start_nodes(extra_args=[[]] * self.num_nodes)
125125
super().import_deterministic_coinbase_privkeys()
126126
self.stop_nodes()

test/lint/lint-spelling.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99

1010
export LC_ALL=C
1111

12+
EXIT_CODE=0
1213
IGNORE_WORDS_FILE=test/lint/lint-spelling.ignore-words.txt
1314
if ! codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=${IGNORE_WORDS_FILE} $(git ls-files -- ":(exclude)build-aux/m4/" ":(exclude)contrib/seeds/*.txt" ":(exclude)depends/" ":(exclude)doc/release-notes/" ":(exclude)src/leveldb/" ":(exclude)src/qt/locale/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/"); then
1415
echo "^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in ${IGNORE_WORDS_FILE}"
16+
EXIT_CODE=1
1517
fi
18+
exit ${EXIT_CODE}

0 commit comments

Comments
 (0)