Skip to content

Commit bfbf91d

Browse files
SjorsMarcoFalke
andcommitted
test: fancier Python for getblockfrompeer
Co-authored-by: MarcoFalke <[email protected]>
1 parent 529ed33 commit bfbf91d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

test/functional/rpc_getblockfrompeer.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ def run_test(self):
4040
self.sync_blocks()
4141

4242
self.log.info("Node 0 should only have the header for node 1's block 3")
43-
for x in self.nodes[0].getchaintips():
44-
if x['hash'] == short_tip:
45-
assert_equal(x['status'], "headers-only")
46-
break
47-
else:
48-
raise AssertionError("short tip not synced")
43+
x = next(filter(lambda x: x['hash'] == short_tip, self.nodes[0].getchaintips()))
44+
assert_equal(x['status'], "headers-only")
4945
assert_raises_rpc_error(-1, "Block not found on disk", self.nodes[0].getblock, short_tip)
5046

5147
self.log.info("Fetch block from node 1")

0 commit comments

Comments
 (0)