aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_sendheaders.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-09-17 14:00:41 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-09-17 14:00:47 -0400
commit4901c00792c1dabae4bb01e6373c9b1ed9ef3008 (patch)
tree55e00ff28fd4dc73dd2adc9c9d745d9845b619c4 /test/functional/p2p_sendheaders.py
parent2d4749b366c4cae3da19017d6658f11349634303 (diff)
parent0ca4c8b3c61984e9e2ab5a2a9a7c47faf139d1fc (diff)
downloadbitcoin-4901c00792c1dabae4bb01e6373c9b1ed9ef3008.tar.xz
Merge #14236: qa: generate --> generatetoaddress change to allow tests run without wallet
0ca4c8b3c6 Changed functional tests which do not require wallets to run without (sanket1729) Pull request description: Addresses #14216 . Changed Changed `get_deterministic_priv_key()` to return named tuple`(address, key)` I have tried to be exhaustive as possible in maximum coverage for non-wallet mode without affecting any coverage for wallet mode. However, I could not check the tests in wallet mode because of timeout issues. Hopefully, travis job checks those. Tests `feature_block.py`, `feature_logging.py` and `feature_reindex.py` were skipping despite having no direct dependency on any wallet functions. So, I have also disabled the `skip_test_no_wallet()` for those files too. Tree-SHA512: 8f84bd8400a732d4266c7518d5cbcf1eb761f623a64a74849e0470142c8ef22cb75364474ddae75d9213c3d16659a52917b5ed979a313695da6abd16c4fd7445
Diffstat (limited to 'test/functional/p2p_sendheaders.py')
-rwxr-xr-xtest/functional/p2p_sendheaders.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/functional/p2p_sendheaders.py b/test/functional/p2p_sendheaders.py
index 9a782c0bb9..d5e8dd4721 100755
--- a/test/functional/p2p_sendheaders.py
+++ b/test/functional/p2p_sendheaders.py
@@ -208,15 +208,12 @@ class SendHeadersTest(BitcoinTestFramework):
self.setup_clean_chain = True
self.num_nodes = 2
- def skip_test_if_missing_module(self):
- self.skip_if_no_wallet()
-
def mine_blocks(self, count):
"""Mine count blocks and return the new tip."""
# Clear out block announcements from each p2p listener
[x.clear_block_announcements() for x in self.nodes[0].p2ps]
- self.nodes[0].generate(count)
+ self.nodes[0].generatetoaddress(count, self.nodes[0].get_deterministic_priv_key().address)
return int(self.nodes[0].getbestblockhash(), 16)
def mine_reorg(self, length):
@@ -226,7 +223,8 @@ class SendHeadersTest(BitcoinTestFramework):
to-be-reorged-out blocks are mined, so that we don't break later tests.
return the list of block hashes newly mined."""
- self.nodes[0].generate(length) # make sure all invalidated blocks are node0's
+ # make sure all invalidated blocks are node0's
+ self.nodes[0].generatetoaddress(length, self.nodes[0].get_deterministic_priv_key().address)
sync_blocks(self.nodes, wait=0.1)
for x in self.nodes[0].p2ps:
x.wait_for_block_announcement(int(self.nodes[0].getbestblockhash(), 16))
@@ -235,7 +233,7 @@ class SendHeadersTest(BitcoinTestFramework):
tip_height = self.nodes[1].getblockcount()
hash_to_invalidate = self.nodes[1].getblockhash(tip_height - (length - 1))
self.nodes[1].invalidateblock(hash_to_invalidate)
- all_hashes = self.nodes[1].generate(length + 1) # Must be longer than the orig chain
+ all_hashes = self.nodes[1].generatetoaddress(length + 1, self.nodes[1].get_deterministic_priv_key().address) # Must be longer than the orig chain
sync_blocks(self.nodes, wait=0.1)
return [int(x, 16) for x in all_hashes]
@@ -254,7 +252,7 @@ class SendHeadersTest(BitcoinTestFramework):
self.test_nonnull_locators(test_node, inv_node)
def test_null_locators(self, test_node, inv_node):
- tip = self.nodes[0].getblockheader(self.nodes[0].generate(1)[0])
+ tip = self.nodes[0].getblockheader(self.nodes[0].generatetoaddress(1, self.nodes[0].get_deterministic_priv_key().address)[0])
tip_hash = int(tip["hash"], 16)
inv_node.check_last_inv_announcement(inv=[tip_hash])