Skip to content

Commit 9f1c431

Browse files
committed
chore: Apply PR comments from Brice
1 parent 487ec0e commit 9f1c431

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

stackslib/src/chainstate/nakamoto/coordinator/tests.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ fn advance_to_nakamoto(
112112
let default_pox_addr =
113113
PoxAddress::from_legacy(AddressHashMode::SerializeP2PKH, addr.bytes.clone());
114114

115-
// Stores the result of a function with side effects, so have Clippy ignore it
116-
#[allow(clippy::collection_is_never_read)]
117-
let mut tip = None;
118115
for sortition_height in 0..11 {
119116
// stack to pox-3 in cycle 7
120117
let txs = if sortition_height == 6 {
@@ -158,7 +155,7 @@ fn advance_to_nakamoto(
158155
vec![]
159156
};
160157

161-
tip = Some(peer.tenure_with_txs(&txs, &mut peer_nonce));
158+
peer.tenure_with_txs(&txs, &mut peer_nonce);
162159
}
163160
// peer is at the start of cycle 8
164161
}

stackslib/src/net/tests/download/epoch2x.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ fn test_get_block_availability() {
216216
})
217217
}
218218

219-
fn get_blocks_inventory(peer: &mut TestPeer, start_height: u64, end_height: u64) -> BlocksInvData {
219+
fn get_blocks_inventory(peer: &TestPeer, start_height: u64, end_height: u64) -> BlocksInvData {
220220
let block_hashes = {
221221
let num_headers = end_height - start_height;
222-
let ic = peer.sortdb.as_mut().unwrap().index_conn();
222+
let ic = peer.sortdb.as_ref().unwrap().index_conn();
223223
let tip = SortitionDB::get_canonical_burn_chain_tip(&ic).unwrap();
224224
let ancestor = SortitionDB::get_ancestor_snapshot(&ic, end_height, &tip.sortition_id)
225225
.unwrap()
@@ -233,7 +233,7 @@ fn get_blocks_inventory(peer: &mut TestPeer, start_height: u64, end_height: u64)
233233
};
234234

235235
let inv = peer
236-
.chainstate()
236+
.chainstate_ref()
237237
.get_blocks_inventory(&block_hashes)
238238
.unwrap();
239239
inv
@@ -476,9 +476,6 @@ where
476476
info!("Completed walk round {} step(s)", round);
477477

478478
for peer in peers.iter_mut() {
479-
// TODO: Remove if this function has no side effects
480-
let _ = get_blocks_inventory(peer, 0, num_burn_blocks);
481-
482479
let availability = get_peer_availability(
483480
peer,
484481
first_stacks_block_height - first_sortition_height,

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3025,8 +3025,6 @@ fn block_proposal_api_endpoint() {
30253025
let http_origin = format!("http://{}", &conf.node.rpc_bind);
30263026
let path = format!("{http_origin}/v3/block_proposal");
30273027

3028-
// Clippy thinks this is unused, but it seems to be holding a lock
3029-
#[allow(clippy::collection_is_never_read)]
30303028
let mut hold_proposal_mutex = Some(test_observer::PROPOSAL_RESPONSES.lock().unwrap());
30313029
for (ix, (test_description, block_proposal, expected_http_code, _)) in
30323030
test_cases.iter().enumerate()
@@ -3084,7 +3082,7 @@ fn block_proposal_api_endpoint() {
30843082

30853083
if ix == 1 {
30863084
// release the test observer mutex so that the handler from 0 can finish!
3087-
hold_proposal_mutex.take();
3085+
_ = hold_proposal_mutex.take();
30883086
}
30893087
}
30903088

0 commit comments

Comments
 (0)