File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,8 @@ impl Args {
223
223
opts. optopt ( "" , "block_raw" , "block-raw api call" , "BLOCK_RAW" ) ;
224
224
opts. optopt ( "" , "block_status" , "block-status api call" , "BLOCK_STATUS" ) ;
225
225
226
+ opts. optflag ( "" , "blocks_tip_height" , "GET /api/blocks/tip/height api call" ) ;
227
+
226
228
//OPTOPT
227
229
opts. optopt ( "c" , "config" , "sets the configuration file" , "CONFIG" ) ;
228
230
opts. optopt ( "s" , "server" , "sets the address of the rustypaste server" , "SERVER" ) ;
@@ -331,6 +333,11 @@ impl Args {
331
333
generic_sys_call ( "block_status" , & block_status. unwrap ( ) ) ;
332
334
std:: process:: exit ( 0 ) ;
333
335
}
336
+ if matches. opt_present ( "blocks_tip_height" ) {
337
+ let blocks_tip_height = matches. opt_str ( "blocks_tip_height" ) ;
338
+ generic_sys_call ( "blocks_tip_height" , & "" ) ;
339
+ std:: process:: exit ( 0 ) ;
340
+ }
334
341
335
342
if matches. opt_present ( "h" )
336
343
|| ( matches. free . is_empty ( )
Original file line number Diff line number Diff line change @@ -346,6 +346,13 @@ mod tests {
346
346
) ;
347
347
wait ( "100" ) ;
348
348
}
349
+ fn test_blocks_tip_height ( ) {
350
+ // GET /api/blocks/tip/height
351
+ let binding = format ! ( "blocks_tip_height" ) . clone ( ) ;
352
+ let block_raw: & str = blocking ( & binding) . expect ( "returns current block_height" ) ;
353
+ let block_raw = generic_sys_call ( "blocks_tip_height" , "extraneous_arg" ) ;
354
+ wait ( "100" ) ;
355
+ }
349
356
#[ test]
350
357
fn test_blockheight ( ) {
351
358
let blockheight = blockheight:: blockheight ( ) ;
You can’t perform that action at this time.
0 commit comments