From efbe18b2422163c0fe10dbad99ec878fce0ba1ad Mon Sep 17 00:00:00 2001 From: Boog900 <54e72d8a-345f-4599-bd90-c6b9bc7d0ec5@aleeas.com> Date: Thu, 13 Jun 2024 15:52:02 +0100 Subject: [PATCH] remove test unwrap --- p2p/cuprate-p2p/src/block_downloader.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/p2p/cuprate-p2p/src/block_downloader.rs b/p2p/cuprate-p2p/src/block_downloader.rs index 8005b7fe..c697d503 100644 --- a/p2p/cuprate-p2p/src/block_downloader.rs +++ b/p2p/cuprate-p2p/src/block_downloader.rs @@ -4,7 +4,7 @@ //! and downloads it. //! //! The block downloader is started by [`download_blocks`]. -use futures::FutureExt; +use futures::{FutureExt, TryFutureExt}; use std::{ cmp::{max, min, Ordering, Reverse}, collections::{BTreeMap, BinaryHeap, HashSet}, @@ -161,8 +161,8 @@ where tokio::spawn( block_downloader .run() - .instrument(Span::current()) - .map(|res| panic!("{res:?}")), + .inspect_err(|e| tracing::debug!("Error downloading blocks: {e}")) + .instrument(Span::current()), ); buffer_stream @@ -476,13 +476,12 @@ where self.block_download_tasks.spawn(async move { ( block_entry_to_get.start_height, - Ok(request_batch_from_peer( + request_batch_from_peer( client, block_entry_to_get.ids, block_entry_to_get.start_height, ) - .await - .unwrap()), + .await, ) });