From 017089fb9046e6f797ffedebd9d89b563e5ef5a4 Mon Sep 17 00:00:00 2001 From: Parsa Ghadimi Date: Wed, 29 May 2024 15:32:22 -0400 Subject: [PATCH] fix(fetcher): forward every imptr to demuxer --- core/fetcher/src/origin.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/core/fetcher/src/origin.rs b/core/fetcher/src/origin.rs index eac1e2f0c..a7f0bfc2c 100644 --- a/core/fetcher/src/origin.rs +++ b/core/fetcher/src/origin.rs @@ -1,7 +1,7 @@ use std::collections::{HashMap, VecDeque}; use lightning_interfaces::prelude::*; -use lightning_interfaces::types::{Blake3Hash, ImmutablePointer, OriginProvider}; +use lightning_interfaces::types::{Blake3Hash, ImmutablePointer}; use lightning_interfaces::OriginProviderSocket; use tokio::sync::{broadcast, mpsc, oneshot}; use tokio::task::JoinSet; @@ -99,13 +99,10 @@ impl OriginFetcher { async fn spawn(&mut self, pointer: ImmutablePointer) { let origin_socket = self.origin_socket.clone(); self.tasks.spawn(async move { - match &pointer.origin { - OriginProvider::IPFS => match origin_socket.run(pointer.clone()).await { - Ok(Ok(hash)) => Ok(SuccessResponse { pointer, hash }), - Ok(Err(_)) => Err(ErrorResponse::OriginFetchError(pointer.uri)), - Err(_) => Err(ErrorResponse::OriginSocketError), - }, - _ => unreachable!(), + match origin_socket.run(pointer.clone()).await { + Ok(Ok(hash)) => Ok(SuccessResponse { pointer, hash }), + Ok(Err(_)) => Err(ErrorResponse::OriginFetchError(pointer.uri)), + Err(_) => Err(ErrorResponse::OriginSocketError), } }); }