File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,34 @@ def run_test(self):
61
61
node .logging (include = ['qt' ])
62
62
assert_equal (node .logging ()['qt' ], True )
63
63
64
+ self .log .info ("test getindexinfo" )
65
+ # Without any indices running the RPC returns an empty object
66
+ assert_equal (node .getindexinfo (), {})
67
+
68
+ # Restart the node with indices and wait for them to sync
69
+ self .restart_node (0 , ["-txindex" , "-blockfilterindex" ])
70
+ self .wait_until (lambda : all (i ["synced" ] for i in node .getindexinfo ().values ()))
71
+
72
+ # Returns a list of all running indices by default
73
+ assert_equal (
74
+ node .getindexinfo (),
75
+ {
76
+ "txindex" : {"synced" : True , "best_block_height" : 200 },
77
+ "basic block filter index" : {"synced" : True , "best_block_height" : 200 }
78
+ }
79
+ )
80
+
81
+ # 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
+ )
88
+
89
+ # Specifying an unknown index name returns an empty result
90
+ assert_equal (node .getindexinfo ("foo" ), {})
91
+
64
92
65
93
if __name__ == '__main__' :
66
94
RpcMiscTest ().main ()
You can’t perform that action at this time.
0 commit comments