@@ -36,7 +36,6 @@ def add_options(self, parser):
3636 def set_test_params (self ):
3737 self .num_nodes = 1
3838 self .setup_clean_chain = True
39- self .supports_cli = False
4039
4140 def get_stats (self ):
4241 return [self .nodes [0 ].getblockstats (hash_or_height = self .start_height + i ) for i in range (self .max_stat_pos + 1 )]
@@ -120,7 +119,7 @@ def run_test(self):
120119
121120 # Check selecting block by hash too
122121 blockhash = self .expected_stats [i ]['blockhash' ]
123- stats_by_hash = self .nodes [0 ].getblockstats (hash_or_height = blockhash )
122+ stats_by_hash = self .nodes [0 ].getblockstats (hash_or_height = self . convert_to_json_for_cli ( blockhash ) )
124123 assert_equal (stats_by_hash , self .expected_stats [i ])
125124
126125 # Make sure each stat can be queried on its own
@@ -162,10 +161,10 @@ def run_test(self):
162161 self .nodes [0 ].getblockstats , hash_or_height = 1 , stats = ['minfee' , f'aaa{ inv_sel_stat } ' ])
163162 # Mainchain's genesis block shouldn't be found on regtest
164163 assert_raises_rpc_error (- 5 , 'Block not found' , self .nodes [0 ].getblockstats ,
165- hash_or_height = '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f' )
164+ hash_or_height = self . convert_to_json_for_cli ( '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f' ) )
166165
167166 # Invalid number of args
168- assert_raises_rpc_error (- 1 , 'getblockstats hash_or_height ( stats )' , self .nodes [0 ].getblockstats , '00' , 1 , 2 )
167+ assert_raises_rpc_error (- 1 , 'getblockstats hash_or_height ( stats )' , self .nodes [0 ].getblockstats , self . convert_to_json_for_cli ( '00' ) , 1 , 2 )
169168 assert_raises_rpc_error (- 1 , 'getblockstats hash_or_height ( stats )' , self .nodes [0 ].getblockstats )
170169
171170 self .log .info ('Test block height 0' )
@@ -186,7 +185,7 @@ def run_test(self):
186185 self .log .info ("Test when only header is known" )
187186 block = self .generateblock (self .nodes [0 ], output = "raw(55)" , transactions = [], submit = False )
188187 self .nodes [0 ].submitheader (block ["hex" ])
189- assert_raises_rpc_error (- 1 , "Block not available (not fully downloaded)" , lambda : self .nodes [0 ].getblockstats (block ['hash' ]))
188+ assert_raises_rpc_error (- 1 , "Block not available (not fully downloaded)" , lambda : self .nodes [0 ].getblockstats (self . convert_to_json_for_cli ( block ['hash' ]) ))
190189
191190 self .log .info ('Test when block is missing' )
192191 (self .nodes [0 ].blocks_path / 'blk00000.dat' ).rename (self .nodes [0 ].blocks_path / 'blk00000.dat.backup' )
0 commit comments