diff --git a/crates/mempool_infra/src/component_server.rs b/crates/mempool_infra/src/component_server.rs index 25d9ec088..85a8a876a 100644 --- a/crates/mempool_infra/src/component_server.rs +++ b/crates/mempool_infra/src/component_server.rs @@ -3,7 +3,7 @@ use tokio::sync::mpsc::{Receiver, Sender}; #[async_trait] pub trait ComponentMessageExecutor { - async fn execute(&self, message: M) -> R; + async fn execute(&mut self, message: M) -> R; } pub struct MessageAndResponseSender diff --git a/crates/mempool_infra/src/component_server_client_test.rs b/crates/mempool_infra/src/component_server_client_test.rs index aac362d1d..0946418a0 100644 --- a/crates/mempool_infra/src/component_server_client_test.rs +++ b/crates/mempool_infra/src/component_server_client_test.rs @@ -65,7 +65,7 @@ impl ComponentATrait for ComponentClient for ComponentA { - async fn execute(&self, message: ComponentAMessages) -> ComponentAResponses { + async fn execute(&mut self, message: ComponentAMessages) -> ComponentAResponses { match message { ComponentAMessages::AGetValue => ComponentAResponses::Value(self.a_get_value().await), } @@ -112,7 +112,7 @@ impl ComponentBTrait for ComponentClient for ComponentB { - async fn execute(&self, message: ComponentBMessages) -> ComponentBResponses { + async fn execute(&mut self, message: ComponentBMessages) -> ComponentBResponses { match message { ComponentBMessages::BGetValue => ComponentBResponses::Value(self.b_get_value().await), }