Skip to content

Commit

Permalink
chore: rename test enum variants to match the fn names
Browse files Browse the repository at this point in the history
  • Loading branch information
uriel-starkware committed Jul 22, 2024
1 parent ab4d6c9 commit c0641ab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions crates/mempool_infra/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum ComponentARequest {

#[derive(Serialize, Deserialize, Debug)]
pub enum ComponentAResponse {
Value(ValueA),
AGetValue(ValueA),
}

#[derive(Serialize, Deserialize, Debug)]
Expand All @@ -28,7 +28,7 @@ pub enum ComponentBRequest {

#[derive(Serialize, Deserialize, Debug)]
pub enum ComponentBResponse {
Value(ValueB),
BGetValue(ValueB),
}

#[async_trait]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const DESERIALIZE_RES_ERROR_MESSAGE: &str = "Could not deserialize server respon
impl ComponentAClientTrait for ComponentClientHttp<ComponentARequest, ComponentAResponse> {
async fn a_get_value(&self) -> ResultA {
match self.send(ComponentARequest::AGetValue).await? {
ComponentAResponse::Value(value) => Ok(value),
ComponentAResponse::AGetValue(value) => Ok(value),
}
}
}
Expand All @@ -54,7 +54,7 @@ impl ComponentAClientTrait for ComponentClientHttp<ComponentARequest, ComponentA
impl ComponentRequestHandler<ComponentARequest, ComponentAResponse> for ComponentA {
async fn handle_request(&mut self, request: ComponentARequest) -> ComponentAResponse {
match request {
ComponentARequest::AGetValue => ComponentAResponse::Value(self.a_get_value().await),
ComponentARequest::AGetValue => ComponentAResponse::AGetValue(self.a_get_value().await),
}
}
}
Expand All @@ -63,7 +63,7 @@ impl ComponentRequestHandler<ComponentARequest, ComponentAResponse> for Componen
impl ComponentBClientTrait for ComponentClientHttp<ComponentBRequest, ComponentBResponse> {
async fn b_get_value(&self) -> ResultB {
match self.send(ComponentBRequest::BGetValue).await? {
ComponentBResponse::Value(value) => Ok(value),
ComponentBResponse::BGetValue(value) => Ok(value),
}
}
}
Expand All @@ -72,7 +72,7 @@ impl ComponentBClientTrait for ComponentClientHttp<ComponentBRequest, ComponentB
impl ComponentRequestHandler<ComponentBRequest, ComponentBResponse> for ComponentB {
async fn handle_request(&mut self, request: ComponentBRequest) -> ComponentBResponse {
match request {
ComponentBRequest::BGetValue => ComponentBResponse::Value(self.b_get_value()),
ComponentBRequest::BGetValue => ComponentBResponse::BGetValue(self.b_get_value()),
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/mempool_infra/tests/component_server_client_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl ComponentAClientTrait for ComponentClient<ComponentARequest, ComponentAResp
async fn a_get_value(&self) -> ResultA {
let res = self.send(ComponentARequest::AGetValue).await;
match res {
ComponentAResponse::Value(value) => Ok(value),
ComponentAResponse::AGetValue(value) => Ok(value),
}
}
}
Expand All @@ -31,7 +31,7 @@ impl ComponentAClientTrait for ComponentClient<ComponentARequest, ComponentAResp
impl ComponentRequestHandler<ComponentARequest, ComponentAResponse> for ComponentA {
async fn handle_request(&mut self, request: ComponentARequest) -> ComponentAResponse {
match request {
ComponentARequest::AGetValue => ComponentAResponse::Value(self.a_get_value().await),
ComponentARequest::AGetValue => ComponentAResponse::AGetValue(self.a_get_value().await),
}
}
}
Expand All @@ -41,7 +41,7 @@ impl ComponentBClientTrait for ComponentClient<ComponentBRequest, ComponentBResp
async fn b_get_value(&self) -> ResultB {
let res = self.send(ComponentBRequest::BGetValue).await;
match res {
ComponentBResponse::Value(value) => Ok(value),
ComponentBResponse::BGetValue(value) => Ok(value),
}
}
}
Expand All @@ -50,7 +50,7 @@ impl ComponentBClientTrait for ComponentClient<ComponentBRequest, ComponentBResp
impl ComponentRequestHandler<ComponentBRequest, ComponentBResponse> for ComponentB {
async fn handle_request(&mut self, request: ComponentBRequest) -> ComponentBResponse {
match request {
ComponentBRequest::BGetValue => ComponentBResponse::Value(self.b_get_value()),
ComponentBRequest::BGetValue => ComponentBResponse::BGetValue(self.b_get_value()),
}
}
}
Expand Down

0 comments on commit c0641ab

Please sign in to comment.