diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-06-22 19:41:07 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-06-22 19:42:35 +0200 |
commit | faa211fc6e3d4984b8edff1d762dd4cba205d982 (patch) | |
tree | 84bd0cc0fc6c90c797b6033642bd02bf1dc32ee4 | |
parent | fa1668bf5084a190b26b022b9e625a7be3defa6e (diff) |
test: Misc cleanup
* Replace wait_until with assert_equal where possible
* Use send_and_ping helper where possible
-rwxr-xr-x | test/functional/p2p_blockfilters.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/test/functional/p2p_blockfilters.py b/test/functional/p2p_blockfilters.py index a0bfa4eff6..47ee7add75 100755 --- a/test/functional/p2p_blockfilters.py +++ b/test/functional/p2p_blockfilters.py @@ -62,12 +62,11 @@ class CompactFiltersTest(BitcoinTestFramework): # Stale blocks by disconnecting nodes 0 & 1, mining, then reconnecting self.disconnect_nodes(0, 1) - self.nodes[0].generate(1) - self.wait_until(lambda: self.nodes[0].getblockcount() == 1000) - stale_block_hash = self.nodes[0].getblockhash(1000) + stale_block_hash = self.nodes[0].generate(1)[0] + assert_equal(self.nodes[0].getblockcount(), 1000) self.nodes[1].generate(1001) - self.wait_until(lambda: self.nodes[1].getblockcount() == 2000) + assert_equal(self.nodes[1].getblockcount(), 2000) # Check that nodes have signalled NODE_COMPACT_FILTERS correctly. assert peer_0.nServices & NODE_COMPACT_FILTERS != 0 @@ -164,8 +163,7 @@ class CompactFiltersTest(BitcoinTestFramework): start_height=1, stop_hash=int(stop_hash, 16), ) - peer_0.send_message(request) - peer_0.sync_with_ping() + peer_0.send_and_ping(request) response = peer_0.pop_cfilters() assert_equal(len(response), 10) @@ -183,8 +181,7 @@ class CompactFiltersTest(BitcoinTestFramework): start_height=1000, stop_hash=int(stale_block_hash, 16), ) - peer_0.send_message(request) - peer_0.sync_with_ping() + peer_0.send_and_ping(request) response = peer_0.pop_cfilters() assert_equal(len(response), 1) |