From ee1b9bef000b7fb42a452faf06c6748a59ac02c7 Mon Sep 17 00:00:00 2001 From: brunoerg Date: Mon, 2 Dec 2024 18:38:30 -0300 Subject: [PATCH 1/2] test: replace `is not` to `!=` when comparing block hash --- test/functional/p2p_compactblocks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/p2p_compactblocks.py b/test/functional/p2p_compactblocks.py index 49cf26d425c13..5a56b8d3b115d 100755 --- a/test/functional/p2p_compactblocks.py +++ b/test/functional/p2p_compactblocks.py @@ -738,7 +738,7 @@ def test_invalid_tx_in_compactblock(self, test_node): test_node.send_and_ping(msg) # Check that the tip didn't advance - assert int(node.getbestblockhash(), 16) is not block.sha256 + assert int(node.getbestblockhash(), 16) != block.sha256 test_node.sync_with_ping() # Helper for enabling cb announcements From 7239ddb7cec38ab5a8aca93c18fb9efa6376421d Mon Sep 17 00:00:00 2001 From: brunoerg Date: Mon, 2 Dec 2024 18:39:35 -0300 Subject: [PATCH 2/2] test: make sure node has all transactions --- test/functional/p2p_compactblocks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/p2p_compactblocks.py b/test/functional/p2p_compactblocks.py index 5a56b8d3b115d..ca36b2fbc069f 100755 --- a/test/functional/p2p_compactblocks.py +++ b/test/functional/p2p_compactblocks.py @@ -733,7 +733,7 @@ def test_invalid_tx_in_compactblock(self, test_node): # Now send the compact block with all transactions prefilled, and # verify that we don't get disconnected. comp_block = HeaderAndShortIDs() - comp_block.initialize_from_block(block, prefill_list=[0, 1, 2, 3, 4], use_witness=True) + comp_block.initialize_from_block(block, prefill_list=list(range(len(block.vtx))), use_witness=True) msg = msg_cmpctblock(comp_block.to_p2p()) test_node.send_and_ping(msg)