Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zeegomo committed Sep 20, 2023
1 parent 2e581c7 commit b030e1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions nomos-services/mempool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ where
)
}
#[cfg(test)]
Self::BlockItem { block, .. } => {
Self::BlockItems { block, .. } => {
write!(f, "MempoolMsg::BlockItem{{block: {block:?}}}")
}
Self::Metrics { .. } => write!(f, "MempoolMsg::Metrics"),
Expand Down Expand Up @@ -173,7 +173,7 @@ where
pool.mark_in_block(&ids, block);
}
#[cfg(test)]
MempoolMsg::BlockTransaction { block, reply_channel } => {
MempoolMsg::BlockItems { block, reply_channel } => {
reply_channel.send(pool.block_items(block)).unwrap_or_else(|_| {
tracing::debug!("could not send back block items")
});
Expand Down
18 changes: 13 additions & 5 deletions nomos-services/mempool/tests/mock.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use nomos_core::{block::BlockId, tx::mock::MockTransaction};
use nomos_core::{
block::BlockId,
tx::mock::{MockTransaction, MockTxId},
};
use nomos_log::{Logger, LoggerSettings};
use nomos_network::{
backends::mock::{Mock, MockBackendMessage, MockConfig, MockMessage},
Expand All @@ -10,14 +13,16 @@ use overwatch_rs::{overwatch::OverwatchRunner, services::handle::ServiceHandle};
use nomos_mempool::{
backend::mockpool::MockPool,
network::adapters::mock::{MockAdapter, MOCK_TX_CONTENT_TOPIC},
MempoolMsg, MempoolService,
MempoolMsg, MempoolService, Settings
};

#[derive(Services)]
struct MockPoolNode {
logging: ServiceHandle<Logger>,
network: ServiceHandle<NetworkService<Mock>>,
mockpool: ServiceHandle<MempoolService<MockAdapter, MockPool<MockTransaction<MockMessage>>>>,
mockpool: ServiceHandle<
MempoolService<MockAdapter, MockPool<MockTransaction<MockMessage>, MockTxId>>,
>,
}

#[test]
Expand Down Expand Up @@ -56,7 +61,10 @@ fn test_mockmempool() {
weights: None,
},
},
mockpool: (),
mockpool: Settings {
backend: (),
network: (),
},
logging: LoggerSettings::default(),
},
None,
Expand All @@ -67,7 +75,7 @@ fn test_mockmempool() {
let network = app.handle().relay::<NetworkService<Mock>>();
let mempool = app
.handle()
.relay::<MempoolService<MockAdapter, MockPool<MockTransaction<MockMessage>>>>();
.relay::<MempoolService<MockAdapter, MockPool<MockTransaction<MockMessage>, MockTxId>>>();

app.spawn(async move {
let network_outbound = network.connect().await.unwrap();
Expand Down

0 comments on commit b030e1f

Please sign in to comment.