mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
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.
This commit is contained in:
parent
43f3ada27b
commit
233a886b42
1 changed files with 6 additions and 0 deletions
|
@ -54,5 +54,11 @@ class GetBlockFilterTest(BitcoinTestFramework):
|
||||||
genesis_hash = self.nodes[0].getblockhash(0)
|
genesis_hash = self.nodes[0].getblockhash(0)
|
||||||
assert_raises_rpc_error(-5, "Unknown filtertype", self.nodes[0].getblockfilter, genesis_hash, "unknown")
|
assert_raises_rpc_error(-5, "Unknown filtertype", self.nodes[0].getblockfilter, genesis_hash, "unknown")
|
||||||
|
|
||||||
|
# Test getblockfilter fails on node without compact block filter index
|
||||||
|
self.restart_node(0, extra_args=["-blockfilterindex=0"])
|
||||||
|
for filter_type in FILTER_TYPES:
|
||||||
|
assert_raises_rpc_error(-1, "Index is not enabled for filtertype {}".format(filter_type),
|
||||||
|
self.nodes[0].getblockfilter, genesis_hash, filter_type)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
GetBlockFilterTest().main()
|
GetBlockFilterTest().main()
|
||||||
|
|
Loading…
Add table
Reference in a new issue