chore: make FetchClient Cloneable (#970)

This commit is contained in:
Matthias Seitz
2023-01-22 21:27:06 +01:00
committed by GitHub
parent a331b54bb0
commit d32710e1ea
2 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ impl Command {
.start_network() .start_network()
.await?; .await?;
let fetch_client = Arc::new(network.fetch_client().await?); let fetch_client = network.fetch_client().await?;
let retries = self.retries.max(1); let retries = self.retries.max(1);
let backoff = ConstantBackoff::default().with_max_times(retries); let backoff = ConstantBackoff::default().with_max_times(retries);
@ -157,7 +157,7 @@ impl Command {
/// Get a single header from network /// Get a single header from network
pub async fn get_single_header( pub async fn get_single_header(
&self, &self,
client: Arc<FetchClient>, client: FetchClient,
id: BlockHashOrNumber, id: BlockHashOrNumber,
) -> eyre::Result<SealedHeader> { ) -> eyre::Result<SealedHeader> {
let request = HeadersRequest { let request = HeadersRequest {

View File

@ -57,7 +57,7 @@ use tokio::sync::{mpsc::UnboundedSender, oneshot};
// end // end
// end // end
/// ``` /// ```
#[derive(Debug)] #[derive(Debug, Clone)]
pub struct FetchClient { pub struct FetchClient {
/// Sender half of the request channel. /// Sender half of the request channel.
pub(crate) request_tx: UnboundedSender<DownloadRequest>, pub(crate) request_tx: UnboundedSender<DownloadRequest>,