Skip to content

Commit ce533e0

Browse files
committed
more restful path for blockbyheight
1 parent 6cc44c6 commit ce533e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

stackslib/src/net/api/getblockbyheight.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ impl HttpRequest for RPCNakamotoBlockByHeightRequestHandler {
6161
}
6262

6363
fn path_regex(&self) -> Regex {
64-
Regex::new(r#"^/v3/blockbyheight/(?P<block_height>[0-9]{1,20})$"#).unwrap()
64+
Regex::new(r#"^/v3/blocks/height/(?P<block_height>[0-9]{1,20})$"#).unwrap()
6565
}
6666

6767
fn metrics_identifier(&self) -> &str {
68-
"/v3/blockbyheight/:block_height"
68+
"/v3/blocks/height/:block_height"
6969
}
7070

7171
/// Try to decode this request.
@@ -212,7 +212,7 @@ impl StacksHttpRequest {
212212
StacksHttpRequest::new_for_peer(
213213
host,
214214
"GET".into(),
215-
format!("/v3/blockbyheight/{}", block_height),
215+
format!("/v3/blocks/height/{}", block_height),
216216
HttpRequestContents::new().for_tip(tip),
217217
)
218218
.expect("FATAL: failed to construct request from infallible data")

testnet/stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9426,7 +9426,7 @@ fn v3_blockbyhash_api_endpoint() {
94269426
run_loop_thread.join().unwrap();
94279427
}
94289428

9429-
/// Test `/v3/blockbyheight` API endpoint
9429+
/// Test `/v3/blocks/height` API endpoint
94309430
///
94319431
/// This endpoint returns the block blob given a height
94329432
#[test]
@@ -9519,7 +9519,7 @@ fn v3_blockbyheight_api_endpoint() {
95199519
let http_origin = format!("http://{}", &conf.node.rpc_bind);
95209520

95219521
let get_v3_block_by_height = |height: u64| {
9522-
let url = &format!("{http_origin}/v3/blockbyheight/{height}");
9522+
let url = &format!("{http_origin}/v3/blocks/height/{height}");
95239523
info!("Send request: GET {url}");
95249524
reqwest::blocking::get(url).unwrap_or_else(|e| panic!("GET request failed: {e}"))
95259525
};

0 commit comments

Comments
 (0)