Skip to content

Commit

Permalink
pub fn blocks:blocks_tip_height:print=false
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyMcMillan committed Sep 4, 2024
1 parent 6d7fc50 commit ba724ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ mod tests {
let get_block = api(
"block",
"000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce",
true
true,
);
wait("1");
}
Expand All @@ -603,7 +603,7 @@ mod tests {
let get_block_header = api(
"block_header",
"000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce",
true
true,
);
wait("1");
}
Expand Down Expand Up @@ -637,7 +637,7 @@ mod tests {
let get_block_raw = api(
"block_raw",
"0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2",
true
true,
);
wait("1");
}
Expand All @@ -651,7 +651,7 @@ mod tests {
let get_block_status = api(
"block_status",
"0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2",
true
true,
);
wait("1");
}
Expand Down Expand Up @@ -686,7 +686,7 @@ mod tests {
let get_block_txid = api(
"block_txid",
"000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce/txid/218",
true
true,
);
use crate::args::block_txid;
block_txid(
Expand All @@ -705,7 +705,7 @@ mod tests {
let get_block_txids = api(
"block_txid",
"000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce/txids",
true
true,
);
use crate::args::block_txids;
block_txids(&"000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce");
Expand All @@ -720,22 +720,22 @@ mod tests {
let get_block_txs = api(
"block_txs",
"000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce/txs",
true
true,
);
let get_block_txs = api(
"block_txs",
"000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce/txs/0",
true
true,
);
let get_block_txs = api(
"block_txs",
"000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce/txs/1", test if start_index_int % 25 == 0
true
true,
);
let get_block_txs = api(
"block_txs",
"000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce/txs/25",
true
true,
);
}
#[test]
Expand Down Expand Up @@ -1038,7 +1038,7 @@ mod tests {
let block_audit_score = api(
"blocks_audit_score",
"000000000000000000032535698c5b0c48283b792cf86c1c6e36ff84464de785",
true
true,
);
wait("1");
}
Expand Down Expand Up @@ -1115,7 +1115,7 @@ mod tests {
let children_pay_for_parent = api(
"children_pay_for_parent",
"e09d8afb19968715a4492205b8db5fe41da144b0c1e4f7a756c8bf9742d4f1f4",
true
true,
);
wait("1");
}
Expand Down
4 changes: 2 additions & 2 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ pub fn block_txs(block_hash: &str, start_index: &str) {
}
/// GET /api/v1/blocks[/:startHeight]
/// <https://mempool.space/docs/api/rest#get-blocks>
pub fn blocks(start_height: &str, print: bool) {
let blocks_tip_height = api::api("blocks_tip_height", "extraneous_arg", print);
pub fn blocks(start_height: &str, _print: bool) {
let blocks_tip_height = api::api("blocks_tip_height", "extraneous_arg", /*print*/false);
let blocks_tip_height_int = blocks_tip_height.parse::<i32>().unwrap_or(0);
let start_height_int = start_height.parse::<i32>().unwrap_or(0);
if start_height_int >= 0 && start_height_int <= blocks_tip_height_int {
Expand Down

0 comments on commit ba724ff

Please sign in to comment.