Skip to content
Merged
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
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-cardano-node-chain"
version = "0.1.5"
version = "0.1.6"
authors.workspace = true
documentation.workspace = true
edition.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ mod tests {
use tokio::net::UnixListener;

use mithril_common::crypto_helper::ColdKeyGenerator;
use mithril_common::test_utils::TempDir;
use mithril_common::test::TempDir;

use super::*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ mod tests {
use std::fs;
use tokio::net::UnixListener;

use mithril_common::{current_function, entities::BlockNumber, test_utils::TempDir};
use mithril_common::{current_function, entities::BlockNumber, test::TempDir};

use crate::test::TestLogger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl ChainObserver for FakeChainObserver {

#[cfg(test)]
mod tests {
use mithril_common::test_utils::{double::Dummy, fake_data};
use mithril_common::test::double::{Dummy, fake_data};

use super::*;

Expand Down
19 changes: 1 addition & 18 deletions internal/cardano-node/mithril-cardano-node-chain/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,4 @@ pub mod double;
pub(crate) mod test_cli_runner;

#[cfg(test)]
pub(crate) struct TestLogger;

#[cfg(test)]
impl TestLogger {
fn from_writer<W: std::io::Write + Send + 'static>(writer: W) -> slog::Logger {
use slog::Drain;
use std::sync::Arc;

let decorator = slog_term::PlainDecorator::new(writer);
let drain = slog_term::CompactFormat::new(decorator).build().fuse();
let drain = slog_async::Async::new(drain).build().fuse();
slog::Logger::root(Arc::new(drain), slog::o!())
}

pub(crate) fn stdout() -> slog::Logger {
Self::from_writer(slog_term::TestStdoutWriter)
}
}
mithril_common::define_test_logger!();
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-cardano-node-internal-database"
version = "0.1.2"
version = "0.1.3"
description = "Mechanisms that allow Mithril nodes to read the files of a Cardano node internal database and compute digests from them"
authors.workspace = true
documentation.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl ImmutableFileDigestCacheProvider for JsonImmutableFileDigestCacheProvider {
mod tests {
use std::{collections::BTreeMap, path::PathBuf};

use mithril_common::test_utils::TempDir;
use mithril_common::test::TempDir;

use crate::digesters::cache::{
ImmutableFileDigestCacheProvider, JsonImmutableFileDigestCacheProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<'a> JsonImmutableFileDigestCacheProviderBuilder<'a> {
mod tests {
use std::path::PathBuf;

use mithril_common::test_utils::TempDir;
use mithril_common::test::TempDir;

use crate::digesters::cache::JsonImmutableFileDigestCacheProviderBuilder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ mod tests {
use std::io::prelude::*;

use mithril_common::temp_dir_create;
use mithril_common::test_utils::TempDir;
use mithril_common::test::TempDir;

use super::*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ mod tests {
use std::fs::{File, create_dir};
use std::io::prelude::*;

use mithril_common::test_utils::temp_dir_create;
use mithril_common::test::temp_dir_create;

use super::*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,4 @@ pub mod fake_data;
pub use dummy_cardano_db::{DummyCardanoDb, DummyCardanoDbBuilder};

#[cfg(test)]
pub(crate) struct TestLogger;

#[cfg(test)]
impl TestLogger {
fn from_writer<W: std::io::Write + Send + 'static>(writer: W) -> slog::Logger {
use slog::Drain;
use std::sync::Arc;

let decorator = slog_term::PlainDecorator::new(writer);
let drain = slog_term::CompactFormat::new(decorator).build().fuse();
let drain = slog_async::Async::new(drain).build().fuse();
slog::Logger::root(Arc::new(drain), slog::o!())
}

pub(crate) fn stdout() -> slog::Logger {
Self::from_writer(slog_term::TestStdoutWriter)
}
}
mithril_common::define_test_logger!();
2 changes: 1 addition & 1 deletion internal/mithril-dmq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mithril-dmq"
description = "Mechanisms to publish and consume messages of a 'Decentralized Message Queue network' through a DMQ node"
version = "0.1.5"
version = "0.1.6"
authors.workspace = true
documentation.workspace = true
edition.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions internal/mithril-dmq/src/consumer/pallas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ mod tests {

use std::{fs, future, time::Duration, vec};

use mithril_common::{crypto_helper::TryToBytes, current_function, test_utils::TempDir};
use mithril_common::{crypto_helper::TryToBytes, current_function, test::TempDir};
use pallas_network::{
facades::DmqServer,
miniprotocols::{localmsgnotification, localmsgsubmission::DmqMsg},
};
use tokio::{net::UnixListener, task::JoinHandle, time::sleep};

use crate::{test::payload::DmqMessageTestPayload, test_tools::TestLogger};
use crate::test::{TestLogger, payload::DmqMessageTestPayload};

use super::*;

Expand Down
25 changes: 0 additions & 25 deletions internal/mithril-dmq/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,3 @@ pub mod test;
pub use consumer::{DmqConsumer, DmqConsumerPallas};
pub use message::DmqMessageBuilder;
pub use publisher::{DmqPublisher, DmqPublisherPallas};

#[cfg(test)]
pub(crate) mod test_tools {
use std::io;
use std::sync::Arc;

use slog::{Drain, Logger};
use slog_async::Async;
use slog_term::{CompactFormat, PlainDecorator};

pub struct TestLogger;

impl TestLogger {
fn from_writer<W: io::Write + Send + 'static>(writer: W) -> Logger {
let decorator = PlainDecorator::new(writer);
let drain = CompactFormat::new(decorator).build().fuse();
let drain = Async::new(drain).build().fuse();
Logger::root(Arc::new(drain), slog::o!())
}

pub fn stdout() -> Logger {
Self::from_writer(slog_term::TestStdoutWriter)
}
}
}
4 changes: 2 additions & 2 deletions internal/mithril-dmq/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ impl DmqMessageBuilder {
mod tests {
use mithril_cardano_node_chain::test::double::FakeChainObserver;
use mithril_common::{
crypto_helper::{KesSignerFake, TryToBytes},
crypto_helper::TryToBytes,
entities::{BlockNumber, ChainPoint, TimePoint},
test_utils::double::Dummy,
test::{crypto_helper::KesSignerFake, double::Dummy},
};

use super::*;
Expand Down
5 changes: 2 additions & 3 deletions internal/mithril-dmq/src/publisher/pallas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,11 @@ mod tests {

use mithril_cardano_node_chain::test::double::FakeChainObserver;
use mithril_common::{
crypto_helper::KesSignerFake,
current_function,
test_utils::{TempDir, double::Dummy},
test::{TempDir, crypto_helper::KesSignerFake, double::Dummy},
};

use crate::{test::payload::DmqMessageTestPayload, test_tools::TestLogger};
use crate::test::{TestLogger, payload::DmqMessageTestPayload};

use super::*;

Expand Down
3 changes: 3 additions & 0 deletions internal/mithril-dmq/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ pub mod double;

#[cfg(test)]
pub(crate) mod payload;

#[cfg(test)]
mithril_common::define_test_logger!();
2 changes: 1 addition & 1 deletion internal/mithril-dmq/src/test/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::fmt::Debug;
use mithril_common::{
StdResult,
crypto_helper::{TryFromBytes, TryToBytes},
test_utils::double::Dummy,
test::double::Dummy,
};

/// A test message payload for the DMQ.
Expand Down
2 changes: 1 addition & 1 deletion internal/mithril-era/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-era"
version = "0.1.3"
version = "0.1.4"
authors.workspace = true
documentation.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion internal/mithril-era/src/adapters/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl EraReaderAdapter for BootstrapAdapter {

#[cfg(test)]
mod tests {
use mithril_common::test_utils::double::Dummy;
use mithril_common::test::double::Dummy;

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion internal/mithril-era/src/adapters/dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl EraReaderAdapter for DummyAdapter {
#[cfg(test)]
mod tests {
use mithril_common::entities::{Epoch, SupportedEra};
use mithril_common::test_utils::double::Dummy;
use mithril_common::test::double::Dummy;

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion internal/mithril-era/src/adapters/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl EraReaderAdapter for FileAdapter {
#[cfg(test)]
mod tests {
use mithril_common::entities::{Epoch, SupportedEra};
use mithril_common::test_utils::{TempDir, double::Dummy};
use mithril_common::test::{TempDir, double::Dummy};

use super::*;

Expand Down
Loading
Loading