Skip to content

Commit

Permalink
Rename testing module and feature to dev to avoid confusion with …
Browse files Browse the repository at this point in the history
…`test`
  • Loading branch information
fjarri committed Nov 15, 2024
1 parent 355a5b5 commit 0727d12
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ tracing = "0.1"
tokio = { version = "1", features = ["rt", "sync", "time", "macros"] }
rand = "0.8"
digest = "0.10"
manul = { path = "../manul", features = ["testing"] }
manul = { path = "../manul", features = ["dev"] }
2 changes: 1 addition & 1 deletion examples/src/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ mod tests {
use alloc::collections::BTreeSet;

use manul::{
dev::{run_sync_with_tracing, BinaryFormat, TestSessionParams, TestSigner},
session::signature::Keypair,
testing::{run_sync_with_tracing, BinaryFormat, TestSessionParams, TestSigner},
};
use rand_core::OsRng;

Expand Down
2 changes: 1 addition & 1 deletion examples/src/simple_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ mod tests {
use alloc::collections::BTreeSet;

use manul::{
dev::{run_sync_with_tracing, BinaryFormat, TestSessionParams, TestSigner},
session::signature::Keypair,
testing::{run_sync_with_tracing, BinaryFormat, TestSessionParams, TestSigner},
};
use rand_core::OsRng;

Expand Down
2 changes: 1 addition & 1 deletion examples/src/simple_malicious.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ use core::fmt::Debug;

use manul::{
combinators::misbehave::{Misbehaving, MisbehavingEntryPoint},
dev::{run_sync_with_tracing, BinaryFormat, TestSessionParams, TestSigner},
protocol::{
Artifact, BoxedRound, Deserializer, DirectMessage, EntryPoint, LocalError, PartyId, ProtocolMessagePart,
RoundId, Serializer,
},
session::signature::Keypair,
testing::{run_sync_with_tracing, BinaryFormat, TestSessionParams, TestSigner},
};
use rand_core::{CryptoRngCore, OsRng};

Expand Down
2 changes: 1 addition & 1 deletion examples/tests/async_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ extern crate alloc;
use alloc::collections::{BTreeMap, BTreeSet};

use manul::{
dev::{BinaryFormat, TestSessionParams, TestSigner},
protocol::Protocol,
session::{
signature::Keypair, CanFinalize, LocalError, Message, RoundOutcome, Session, SessionId, SessionParameters,
SessionReport,
},
testing::{BinaryFormat, TestSessionParams, TestSigner},
};
use manul_example::simple::{SimpleProtocol, SimpleProtocolEntryPoint};
use rand::Rng;
Expand Down
4 changes: 2 additions & 2 deletions manul/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tracing-subscriber = { version = "0.3", features = ["std", "fmt", "env-filter"]
tracing = { version = "0.1", default-features = false, features = ["std"] }

[features]
testing = ["rand", "postcard", "serde_json", "tracing/std", "serde-persistent-deserializer", "tracing-subscriber"]
dev = ["rand", "postcard", "serde_json", "tracing/std", "serde-persistent-deserializer", "tracing-subscriber"]

[package.metadata.docs.rs]
all-features = true
Expand All @@ -53,4 +53,4 @@ rustdoc-args = ["--cfg", "docsrs"]
[[bench]]
name = "empty_rounds"
harness = false
required-features = ["testing"]
required-features = ["dev"]
2 changes: 1 addition & 1 deletion manul/benches/empty_rounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use core::fmt::Debug;

use criterion::{criterion_group, criterion_main, Criterion};
use manul::{
dev::{run_sync, BinaryFormat, TestSessionParams, TestSigner},
protocol::{
Artifact, BoxedRound, Deserializer, DirectMessage, EchoBroadcast, EntryPoint, FinalizeError, FinalizeOutcome,
LocalError, NormalBroadcast, PartyId, Payload, Protocol, ProtocolMessagePart, ReceiveError, Round, RoundId,
Serializer,
},
session::signature::Keypair,
testing::{run_sync, BinaryFormat, TestSessionParams, TestSigner},
};
use rand_core::{CryptoRngCore, OsRng};
use serde::{Deserialize, Serialize};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions manul/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pub mod protocol;
pub mod session;
pub(crate) mod utils;

#[cfg(any(test, feature = "testing"))]
pub mod testing;
#[cfg(any(test, feature = "dev"))]
pub mod dev;

#[cfg(test)]
mod tests;
4 changes: 2 additions & 2 deletions manul/src/session/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl SessionId {
///
/// **Warning:** this should generally be used for testing; creating a random session ID in a centralized way
/// usually defeats the purpose of having a distributed protocol.
#[cfg(any(test, feature = "testing"))]
#[cfg(any(test, feature = "dev"))]
pub fn random<SP: SessionParameters>(rng: &mut impl CryptoRngCore) -> Self {
let mut buffer = digest::Output::<SP::Digest>::default();
rng.fill_bytes(&mut buffer);
Expand Down Expand Up @@ -850,8 +850,8 @@ mod tests {

use super::{Message, ProcessedArtifact, ProcessedMessage, Session, VerifiedMessage};
use crate::{
dev::{BinaryFormat, TestSessionParams, TestVerifier},
protocol::Protocol,
testing::{BinaryFormat, TestSessionParams, TestVerifier},
};

#[test]
Expand Down
2 changes: 1 addition & 1 deletion manul/src/tests/partial_echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ use rand_core::{CryptoRngCore, OsRng};
use serde::{Deserialize, Serialize};

use crate::{
dev::{run_sync_with_tracing, BinaryFormat, TestSessionParams, TestSigner, TestVerifier},
protocol::*,
session::signature::Keypair,
testing::{run_sync_with_tracing, BinaryFormat, TestSessionParams, TestSigner, TestVerifier},
};

#[derive(Debug)]
Expand Down

0 comments on commit 0727d12

Please sign in to comment.