Skip to content

Commit c9dbe31

Browse files
committed
cargo fmt
1 parent d97f7ab commit c9dbe31

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

stackslib/src/net/api/gethealth.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,14 @@ impl RPCRequestHandler for RPCGetHealthRequestHandler {
106106
) -> Result<(HttpResponsePreamble, HttpResponseContents), NetError> {
107107
let (max_stacks_height_of_neighbors, node_stacks_tip_height) =
108108
node.with_node_state(|network, _sortdb, _chainstate, _mempool, _rpc_args| {
109-
(
110-
network.highest_stacks_neighbor,
111-
network.stacks_tip.height,
112-
)
109+
(network.highest_stacks_neighbor, network.stacks_tip.height)
113110
});
114111

115-
let (max_stacks_neighbor_address, max_stacks_height_of_neighbors) = match max_stacks_height_of_neighbors {
116-
Some((addr, height)) => (Some(addr.to_string()), height),
117-
None => (None, 0),
118-
};
112+
let (max_stacks_neighbor_address, max_stacks_height_of_neighbors) =
113+
match max_stacks_height_of_neighbors {
114+
Some((addr, height)) => (Some(addr.to_string()), height),
115+
None => (None, 0),
116+
};
119117
// There could be a edge case where our node is ahead of all peers.
120118
let difference_from_max_peer =
121119
max_stacks_height_of_neighbors.saturating_sub(node_stacks_tip_height);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ fn test_get_health(
7171
node_stacks_tip_height + (peer_1_height_relative_to_node as u64)
7272
};
7373
let peer_1_addr: SocketAddr = rpc_test.peer_1.config.data_url.parse().unwrap();
74-
rpc_test.peer_2.network.highest_stacks_neighbor = Some((peer_1_addr.clone(), peer_1_actual_height));
74+
rpc_test.peer_2.network.highest_stacks_neighbor =
75+
Some((peer_1_addr.clone(), peer_1_actual_height));
7576

7677
// --- Invoke the Handler ---
7778
let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 33333);

stackslib/src/net/tests/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,10 @@ fn test_update_highest_stacks_height_of_neighbors(
18221822
let peer_config = TestPeerConfig::new(function_name!(), 0, 0);
18231823
let mut peer = TestPeer::new(peer_config);
18241824
if let Some(old_height) = old_height {
1825-
peer.network.highest_stacks_neighbor = Some((SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080), old_height));
1825+
peer.network.highest_stacks_neighbor = Some((
1826+
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080),
1827+
old_height,
1828+
));
18261829
} else {
18271830
peer.network.highest_stacks_neighbor = None;
18281831
}
@@ -1843,8 +1846,8 @@ fn test_update_highest_stacks_height_of_neighbors(
18431846
let new_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8081);
18441847
node_state.update_highest_stacks_neighbor(&new_addr, new_height);
18451848
if let Some(new_height) = new_height {
1846-
assert_eq!(
1847-
peer.network.highest_stacks_neighbor,
1849+
assert_eq!(
1850+
peer.network.highest_stacks_neighbor,
18481851
Some((new_addr, expected_height))
18491852
);
18501853
} else {

0 commit comments

Comments
 (0)