Skip to content

Commit faa211f

Browse files
author
MarcoFalke
committed
test: Misc cleanup
* Replace wait_until with assert_equal where possible * Use send_and_ping helper where possible
1 parent fa1668b commit faa211f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/functional/p2p_blockfilters.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ def run_test(self):
6262
# Stale blocks by disconnecting nodes 0 & 1, mining, then reconnecting
6363
self.disconnect_nodes(0, 1)
6464

65-
self.nodes[0].generate(1)
66-
self.wait_until(lambda: self.nodes[0].getblockcount() == 1000)
67-
stale_block_hash = self.nodes[0].getblockhash(1000)
65+
stale_block_hash = self.nodes[0].generate(1)[0]
66+
assert_equal(self.nodes[0].getblockcount(), 1000)
6867

6968
self.nodes[1].generate(1001)
70-
self.wait_until(lambda: self.nodes[1].getblockcount() == 2000)
69+
assert_equal(self.nodes[1].getblockcount(), 2000)
7170

7271
# Check that nodes have signalled NODE_COMPACT_FILTERS correctly.
7372
assert peer_0.nServices & NODE_COMPACT_FILTERS != 0
@@ -164,8 +163,7 @@ def run_test(self):
164163
start_height=1,
165164
stop_hash=int(stop_hash, 16),
166165
)
167-
peer_0.send_message(request)
168-
peer_0.sync_with_ping()
166+
peer_0.send_and_ping(request)
169167
response = peer_0.pop_cfilters()
170168
assert_equal(len(response), 10)
171169

@@ -183,8 +181,7 @@ def run_test(self):
183181
start_height=1000,
184182
stop_hash=int(stale_block_hash, 16),
185183
)
186-
peer_0.send_message(request)
187-
peer_0.sync_with_ping()
184+
peer_0.send_and_ping(request)
188185
response = peer_0.pop_cfilters()
189186
assert_equal(len(response), 1)
190187

0 commit comments

Comments
 (0)