Skip to content

Commit

Permalink
chore: separate mempool infra test utils from test
Browse files Browse the repository at this point in the history
commit-id:678cdaac
  • Loading branch information
Itay-Tsabary-Starkware committed Jun 6, 2024
1 parent 33f7de3 commit 09712b6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
14 changes: 14 additions & 0 deletions crates/mempool_infra/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use async_trait::async_trait;

type ValueA = u32;
type ValueB = u8;

#[async_trait]
pub(crate) trait ComponentATrait: Send + Sync {
async fn a_get_value(&self) -> ValueA;
}

#[async_trait]
pub(crate) trait ComponentBTrait: Send + Sync {
async fn b_get_value(&self) -> ValueB;
}
10 changes: 2 additions & 8 deletions crates/mempool_infra/tests/component_server_client_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ use tokio::task;
type ValueA = u32;
type ValueB = u8;

#[async_trait]
trait ComponentATrait: Send + Sync {
async fn a_get_value(&self) -> ValueA;
}
mod common;

#[async_trait]
trait ComponentBTrait: Send + Sync {
async fn b_get_value(&self) -> ValueB;
}
use common::{ComponentATrait, ComponentBTrait};

struct ComponentA {
b: Box<dyn ComponentBTrait>,
Expand Down

0 comments on commit 09712b6

Please sign in to comment.