Skip to content

Commit 46dd568

Browse files
committed
update hardcoded v2 references to v3
1 parent 1f74c45 commit 46dd568

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

docs/rpc-endpoints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ Determine whether a given trait is implemented within the specified contract (ei
427427

428428
See OpenAPI [spec](./rpc/openapi.yaml) for details.
429429

430-
### POST /v2/block_proposal
430+
### POST /v3/block_proposal
431431

432432
Used by miner to validate a proposed Stacks block using JSON encoding.
433433

docs/rpc/openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ paths:
568568
description: The Stacks chain tip to query from. If tip == latest, the query will be run from the latest
569569
known tip (includes unconfirmed state).
570570

571-
/v2/block_proposal:
571+
/v3/block_proposal:
572572
post:
573573
summary: Validate a proposed Stacks block
574574
tags:
@@ -600,7 +600,7 @@ paths:
600600
example:
601601
$ref: ./api/core-node/post-block-proposal-req.example.json
602602

603-
/v2/stacker_set/{cycle_number}:
603+
/v3/stacker_set/{cycle_number}:
604604
get:
605605
summary: Fetch the stacker and signer set information for a given cycle.
606606
tags:

stackslib/src/net/api/getstackers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ impl HttpRequest for GetStackersRequestHandler {
9696
}
9797

9898
fn path_regex(&self) -> Regex {
99-
Regex::new(r#"^/v2/stacker_set/(?P<cycle_num>[0-9]{1,20})$"#).unwrap()
99+
Regex::new(r#"^/v3/stacker_set/(?P<cycle_num>[0-9]{1,20})$"#).unwrap()
100100
}
101101

102102
fn metrics_identifier(&self) -> &str {
103-
"/v2/stacker_set/:cycle_num"
103+
"/v3/stacker_set/:cycle_num"
104104
}
105105

106106
/// Try to decode this request.
@@ -211,7 +211,7 @@ impl StacksHttpRequest {
211211
StacksHttpRequest::new_for_peer(
212212
host,
213213
"GET".into(),
214-
format!("/v2/stacker_set/{cycle_num}"),
214+
format!("/v3/stacker_set/{cycle_num}"),
215215
HttpRequestContents::new().for_tip(tip_req),
216216
)
217217
.expect("FATAL: failed to construct request from infallible data")

stackslib/src/net/api/postblock_proposal.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl From<Result<BlockValidateOk, BlockValidateReject>> for BlockValidateRespons
163163
}
164164
}
165165

166-
/// Represents a block proposed to the `v2/block_proposal` endpoint for validation
166+
/// Represents a block proposed to the `v3/block_proposal` endpoint for validation
167167
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
168168
pub struct NakamotoBlockProposal {
169169
/// Proposed block
@@ -431,11 +431,11 @@ impl HttpRequest for RPCBlockProposalRequestHandler {
431431
}
432432

433433
fn path_regex(&self) -> Regex {
434-
Regex::new(r#"^/v2/block_proposal$"#).unwrap()
434+
Regex::new(r#"^/v3/block_proposal$"#).unwrap()
435435
}
436436

437437
fn metrics_identifier(&self) -> &str {
438-
"/v2/block_proposal"
438+
"/v3/block_proposal"
439439
}
440440

441441
/// Try to decode this request.

stackslib/src/net/api/poststackerdbchunk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl HttpRequest for RPCPostStackerDBChunkRequestHandler {
8383
}
8484

8585
fn metrics_identifier(&self) -> &str {
86-
"/v2/block_proposal/:principal/:contract_name/chunks"
86+
"/v3/block_proposal/:principal/:contract_name/chunks"
8787
}
8888

8989
/// Try to decode this request.

stackslib/src/net/api/tests/postblock_proposal.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn test_try_parse_request() {
6969
let mut request = StacksHttpRequest::new_for_peer(
7070
addr.into(),
7171
"POST".into(),
72-
"/v2/block_proposal".into(),
72+
"/v3/block_proposal".into(),
7373
HttpRequestContents::new().payload_json(serde_json::to_value(proposal).unwrap()),
7474
)
7575
.expect("failed to construct request");
@@ -320,7 +320,7 @@ fn test_try_make_response() {
320320
let mut request = StacksHttpRequest::new_for_peer(
321321
rpc_test.peer_1.to_peer_host(),
322322
"POST".into(),
323-
"/v2/block_proposal".into(),
323+
"/v3/block_proposal".into(),
324324
HttpRequestContents::new().payload_json(serde_json::to_value(proposal).unwrap()),
325325
)
326326
.expect("failed to construct request");
@@ -340,7 +340,7 @@ fn test_try_make_response() {
340340
let mut request = StacksHttpRequest::new_for_peer(
341341
rpc_test.peer_1.to_peer_host(),
342342
"POST".into(),
343-
"/v2/block_proposal".into(),
343+
"/v3/block_proposal".into(),
344344
HttpRequestContents::new().payload_json(serde_json::to_value(proposal).unwrap()),
345345
)
346346
.expect("failed to construct request");
@@ -360,7 +360,7 @@ fn test_try_make_response() {
360360
let mut request = StacksHttpRequest::new_for_peer(
361361
rpc_test.peer_1.to_peer_host(),
362362
"POST".into(),
363-
"/v2/block_proposal".into(),
363+
"/v3/block_proposal".into(),
364364
HttpRequestContents::new().payload_json(serde_json::to_value(proposal).unwrap()),
365365
)
366366
.expect("failed to construct request");

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl TestSigningChannel {
231231

232232
pub fn get_stacker_set(http_origin: &str, cycle: u64) -> GetStackersResponse {
233233
let client = reqwest::blocking::Client::new();
234-
let path = format!("{http_origin}/v2/stacker_set/{cycle}");
234+
let path = format!("{http_origin}/v3/stacker_set/{cycle}");
235235
let res = client
236236
.get(&path)
237237
.send()
@@ -2234,7 +2234,7 @@ fn correct_burn_outs() {
22342234
run_loop_thread.join().unwrap();
22352235
}
22362236

2237-
/// Test `/v2/block_proposal` API endpoint
2237+
/// Test `/v3/block_proposal` API endpoint
22382238
///
22392239
/// This endpoint allows miners to propose Nakamoto blocks to a node,
22402240
/// and test if they would be accepted or rejected
@@ -2471,7 +2471,7 @@ fn block_proposal_api_endpoint() {
24712471
.expect("Failed to build `reqwest::Client`");
24722472
// Build URL
24732473
let http_origin = format!("http://{}", &conf.node.rpc_bind);
2474-
let path = format!("{http_origin}/v2/block_proposal");
2474+
let path = format!("{http_origin}/v3/block_proposal");
24752475

24762476
let mut hold_proposal_mutex = Some(test_observer::PROPOSAL_RESPONSES.lock().unwrap());
24772477
for (ix, (test_description, block_proposal, expected_http_code, _)) in

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ pub fn get_contract_src(
13941394

13951395
pub fn get_stacker_set(http_origin: &str, reward_cycle: u64) -> GetStackersResponse {
13961396
let client = reqwest::blocking::Client::new();
1397-
let path = format!("{}/v2/stacker_set/{}", http_origin, reward_cycle);
1397+
let path = format!("{}/v3/stacker_set/{}", http_origin, reward_cycle);
13981398
let res = client.get(&path).send().unwrap();
13991399

14001400
info!("Got stacker_set response {:?}", &res);

0 commit comments

Comments
 (0)