Skip to content

Commit 31ac6f1

Browse files
committed
blocks_tip_height:fix
1 parent b2c9417 commit 31ac6f1

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/args.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,7 @@ impl Args {
334334
std::process::exit(0);
335335
}
336336
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", &"");
337+
generic_sys_call("blocks_tip_height", &"extraneous_arg");
339338
std::process::exit(0);
340339
}
341340

src/lib.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ mod tests {
301301
);
302302
wait("1");
303303
}
304+
#[test]
304305
fn test_block_header() {
305306
// GET /api/block/:hash/header
306307
let binding = format!("block/000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce").clone();
@@ -311,20 +312,23 @@ mod tests {
311312
);
312313
wait("1");
313314
}
315+
#[test]
314316
fn test_block_height() {
315317
// GET /api/block-height:height
316318
let binding = format!("block-height/615615").clone();
317319
let block_height: &str = blocking(&binding).expect("an existing block hash is needed");
318320
let block_height = generic_sys_call("block_height", "615615");
319321
wait("1");
320322
}
323+
#[test]
321324
fn test_blocks_timestamp() {
322325
// GET /api/v1/mining/blocks/timestamp/:timestamp
323326
let binding = format!("v1/mining/blocks/timestamp/1672531200").clone();
324327
let timestamp: &str = blocking(&binding).expect("an existing block hash is needed");
325328
let timestamp = generic_sys_call("blocks_timestamp", "1672531200");
326329
wait("1");
327330
}
331+
#[test]
328332
fn test_block_raw() {
329333
// GET /api/block/:hash/raw
330334
let binding = format!("block/0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2").clone();
@@ -333,9 +337,10 @@ mod tests {
333337
"block_raw",
334338
"0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2",
335339
);
336-
wait("100");
340+
wait("1");
337341
}
338342

343+
#[test]
339344
fn test_block_status() {
340345
// GET /api/block/:hash/status
341346
let binding = format!("block/0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2").clone();
@@ -344,14 +349,15 @@ mod tests {
344349
"block_status",
345350
"0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2",
346351
);
347-
wait("100");
352+
wait("1");
348353
}
354+
#[test]
349355
fn test_blocks_tip_height() {
350356
// GET /api/blocks/tip/height
351-
let binding = format!("blocks_tip_height").clone();
357+
let binding = format!("blocks/tip/height").clone();
352358
let block_raw: &str = blocking(&binding).expect("returns current block_height");
353359
let block_raw = generic_sys_call("blocks_tip_height", "extraneous_arg");
354-
wait("100");
360+
wait("1");
355361
}
356362
#[test]
357363
fn test_blockheight() {
@@ -380,7 +386,6 @@ mod tests {
380386
// assert_ne!(bad_add(1, 2), 3);
381387
wait("1");
382388
}
383-
384389
use std::panic::{catch_unwind, AssertUnwindSafe};
385390
#[test]
386391
fn should_panic() {

0 commit comments

Comments
 (0)