Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: separate mempool infra test utils from test #215

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading