Skip to content

Commit e6e9ff8

Browse files
test: Fix functional tests to work with new blockfilterindex defaults
Three tests needed updates to work with the new defaults where -blockfilterindex=basic and -peerblockfilters=true: - p2p_blockfilters.py: Explicitly disable peerblockfilters for node 1 which doesn't serve compact filters - rpc_getblockfilter.py: Explicitly disable both options for nodes that should not have block filter index - rpc_misc.py: Explicitly disable both options when testing the absence of indices 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ef2a1e3 commit e6e9ff8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

test/functional/p2p_blockfilters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def set_test_params(self):
4747
self.num_nodes = 2
4848
self.extra_args = [
4949
["-blockfilterindex", "-peerblockfilters"],
50-
["-blockfilterindex"],
50+
["-blockfilterindex", "-peerblockfilters=0"],
5151
]
5252

5353
def run_test(self):
@@ -264,7 +264,7 @@ def run_test(self):
264264

265265
self.log.info("Test -peerblockfilters without -blockfilterindex raises an error")
266266
self.stop_node(0)
267-
self.nodes[0].extra_args = ["-peerblockfilters"]
267+
self.nodes[0].extra_args = ["-peerblockfilters", "-blockfilterindex=0"]
268268
msg = "Error: Cannot set -peerblockfilters without -blockfilterindex."
269269
self.nodes[0].assert_start_raises_init_error(expected_msg=msg)
270270

test/functional/rpc_getblockfilter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class GetBlockFilterTest(BitcoinTestFramework):
1515
def set_test_params(self):
1616
self.setup_clean_chain = True
1717
self.num_nodes = 2
18-
self.extra_args = [["-blockfilterindex"], []]
18+
self.extra_args = [["-blockfilterindex"], ["-blockfilterindex=0", "-peerblockfilters=0"]]
1919

2020
def run_test(self):
2121
# Create two chains by disconnecting nodes 0 & 1, mining, then reconnecting
@@ -55,7 +55,7 @@ def run_test(self):
5555
assert_raises_rpc_error(-5, "Unknown filtertype", self.nodes[0].getblockfilter, genesis_hash, "unknown")
5656

5757
# Test getblockfilter fails on node without compact block filter index
58-
self.restart_node(0, extra_args=["-blockfilterindex=0"])
58+
self.restart_node(0, extra_args=["-blockfilterindex=0", "-peerblockfilters=0"])
5959
for filter_type in FILTER_TYPES:
6060
assert_raises_rpc_error(-1, "Index is not enabled for filtertype {}".format(filter_type),
6161
self.nodes[0].getblockfilter, genesis_hash, filter_type)

test/functional/rpc_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def run_test(self):
8181
assert_equal(node.echoipc("hello"), "hello")
8282

8383
self.log.info("test getindexinfo")
84-
self.restart_node(0, ["-txindex=0"])
84+
self.restart_node(0, ["-txindex=0", "-blockfilterindex=0", "-peerblockfilters=0"])
8585
# Without any indices running the RPC returns an empty object
8686
assert_equal(node.getindexinfo(), {})
8787

0 commit comments

Comments
 (0)