diff --git a/crates/mempool_infra/src/component_client.rs b/crates/mempool_infra/src/component_client.rs index 020bd6bd..6c6a6bb2 100644 --- a/crates/mempool_infra/src/component_client.rs +++ b/crates/mempool_infra/src/component_client.rs @@ -1,3 +1,4 @@ +use thiserror::Error; use tokio::sync::mpsc::{channel, Sender}; use crate::component_definitions::ComponentRequestAndResponseSender; @@ -30,3 +31,9 @@ where res_rx.recv().await.expect("Inbound connection should be open.") } } + +#[derive(Debug, Error)] +pub enum ClientError { + #[error("Got an unexpected response type.")] + UnexpectedResponse, +} diff --git a/crates/mempool_types/src/mempool_types.rs b/crates/mempool_types/src/mempool_types.rs index 856ffc9d..cd9fbabc 100644 --- a/crates/mempool_types/src/mempool_types.rs +++ b/crates/mempool_types/src/mempool_types.rs @@ -1,7 +1,7 @@ use async_trait::async_trait; use starknet_api::core::{ContractAddress, Nonce}; use starknet_api::transaction::{Tip, TransactionHash}; -use starknet_mempool_infra::component_client::ComponentClient; +use starknet_mempool_infra::component_client::{ClientError, ComponentClient}; use starknet_mempool_infra::component_definitions::ComponentRequestAndResponseSender; use thiserror::Error; @@ -46,11 +46,6 @@ pub enum MempoolClientError { pub type MempoolClientResult = Result; // TODO(Tsabary, 1/6/2024): Move communication-related definitions to a separate file. -#[derive(Debug, Error)] -pub enum ClientError { - #[error("Got an unexpected response type.")] - UnexpectedResponse, -} /// Serves as the mempool's shared interface. Requires `Send + Sync` to allow transferring and /// sharing resources (inputs, futures) across threads.