Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_misc.py
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.log.info("test logging") | self.log.info("test logging") | ||||
assert_equal(node.logging()['qt'], True) | assert_equal(node.logging()['qt'], True) | ||||
node.logging(exclude=['qt']) | node.logging(exclude=['qt']) | ||||
assert_equal(node.logging()['qt'], False) | assert_equal(node.logging()['qt'], False) | ||||
node.logging(include=['qt']) | node.logging(include=['qt']) | ||||
assert_equal(node.logging()['qt'], True) | assert_equal(node.logging()['qt'], True) | ||||
self.log.info("test getindexinfo") | |||||
# Without any indices running the RPC returns an empty object | |||||
assert_equal(node.getindexinfo(), {}) | |||||
# Restart the node with indices and wait for them to sync | |||||
self.restart_node(0, ["-txindex", "-blockfilterindex"]) | |||||
self.wait_until( | |||||
lambda: all(i["synced"] for i in node.getindexinfo().values())) | |||||
# Returns a list of all running indices by default | |||||
assert_equal( | |||||
node.getindexinfo(), | |||||
{ | |||||
"txindex": {"synced": True, "best_block_height": 200}, | |||||
"basic block filter index": {"synced": True, "best_block_height": 200} | |||||
} | |||||
) | |||||
# Specifying an index by name returns only the status of that index | |||||
assert_equal( | |||||
node.getindexinfo("txindex"), | |||||
{ | |||||
"txindex": {"synced": True, "best_block_height": 200}, | |||||
} | |||||
) | |||||
# Specifying an unknown index name returns an empty result | |||||
assert_equal(node.getindexinfo("foo"), {}) | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
RpcMiscTest().main() | RpcMiscTest().main() |