Skip to content

Commit 233a886

Browse files
committed
test: check that getblockfilter RPC fails without block filter index
If a node was started without compact block filter index, i.e. parameter `--blockfilterindex=0`, the `getblockfilter` RPC call should fail.
1 parent 43f3ada commit 233a886

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/functional/rpc_getblockfilter.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,11 @@ def run_test(self):
5454
genesis_hash = self.nodes[0].getblockhash(0)
5555
assert_raises_rpc_error(-5, "Unknown filtertype", self.nodes[0].getblockfilter, genesis_hash, "unknown")
5656

57+
# Test getblockfilter fails on node without compact block filter index
58+
self.restart_node(0, extra_args=["-blockfilterindex=0"])
59+
for filter_type in FILTER_TYPES:
60+
assert_raises_rpc_error(-1, "Index is not enabled for filtertype {}".format(filter_type),
61+
self.nodes[0].getblockfilter, genesis_hash, filter_type)
62+
5763
if __name__ == '__main__':
5864
GetBlockFilterTest().main()

0 commit comments

Comments
 (0)