Skip to content

Commit 655d929

Browse files
jonatackfjahr
authored andcommitted
test: add coinstatsindex getindexinfo coverage, improve current tests
1 parent ca01bb8 commit 655d929

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

test/functional/rpc_misc.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,22 @@ def run_test(self):
6666
assert_equal(node.getindexinfo(), {})
6767

6868
# Restart the node with indices and wait for them to sync
69-
self.restart_node(0, ["-txindex", "-blockfilterindex"])
69+
self.restart_node(0, ["-txindex", "-blockfilterindex", "-coinstatsindex"])
7070
self.wait_until(lambda: all(i["synced"] for i in node.getindexinfo().values()))
7171

7272
# Returns a list of all running indices by default
73+
values = {"synced": True, "best_block_height": 200}
7374
assert_equal(
7475
node.getindexinfo(),
7576
{
76-
"txindex": {"synced": True, "best_block_height": 200},
77-
"basic block filter index": {"synced": True, "best_block_height": 200}
77+
"txindex": values,
78+
"basic block filter index": values,
79+
"coinstatsindex": values,
7880
}
7981
)
80-
8182
# Specifying an index by name returns only the status of that index
82-
assert_equal(
83-
node.getindexinfo("txindex"),
84-
{
85-
"txindex": {"synced": True, "best_block_height": 200},
86-
}
87-
)
83+
for i in {"txindex", "basic block filter index", "coinstatsindex"}:
84+
assert_equal(node.getindexinfo(i), {i: values})
8885

8986
# Specifying an unknown index name returns an empty result
9087
assert_equal(node.getindexinfo("foo"), {})

0 commit comments

Comments
 (0)