Skip to content

Commit

Permalink
move test
Browse files Browse the repository at this point in the history
  • Loading branch information
oblique committed Sep 15, 2023
1 parent 096b508 commit b31d891
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions node/src/exchange/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ mod tests {
}

#[tokio::test]
async fn request_range_responds_with_unsorted_headers() {
async fn request_range() {
let peer_tracker = peer_tracker_with_n_peers(15);
let mut mock_req = MockReq::new();
let mut handler = ExchangeClientHandler::<MockReq>::new(peer_tracker);
Expand All @@ -336,15 +336,14 @@ mod tests {
handler.on_send_request(&mut mock_req, HeaderRequest::with_origin(5, 3), tx);

let expected = vec![
gen_header_response(7),
gen_header_response(5),
gen_header_response(6),
gen_header_response(7),
];
let mut expected_headers = expected
let expected_headers = expected
.iter()
.map(|hdr| hdr.to_extended_header().unwrap())
.map(|header| header.to_extended_header().unwrap())
.collect::<Vec<_>>();
expected_headers.sort_by_key(|hdr| hdr.height());

mock_req.send_n_responses(&mut handler, 1, expected);

Expand All @@ -354,7 +353,7 @@ mod tests {
}

#[tokio::test]
async fn request_range() {
async fn request_range_responds_with_unsorted_headers() {
let peer_tracker = peer_tracker_with_n_peers(15);
let mut mock_req = MockReq::new();
let mut handler = ExchangeClientHandler::<MockReq>::new(peer_tracker);
Expand All @@ -364,14 +363,15 @@ mod tests {
handler.on_send_request(&mut mock_req, HeaderRequest::with_origin(5, 3), tx);

let expected = vec![
gen_header_response(7),
gen_header_response(5),
gen_header_response(6),
gen_header_response(7),
];
let expected_headers = expected
let mut expected_headers = expected
.iter()
.map(|hdr| hdr.to_extended_header().unwrap())
.map(|header| header.to_extended_header().unwrap())
.collect::<Vec<_>>();
expected_headers.sort_by_key(|header| header.height());

mock_req.send_n_responses(&mut handler, 1, expected);

Expand Down

0 comments on commit b31d891

Please sign in to comment.