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: move generators module #8429

Merged
merged 3 commits into from
May 28, 2024
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
2 changes: 2 additions & 0 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion crates/interfaces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ reth-fs-util.workspace = true
reth-network-p2p.workspace = true
reth-storage-errors.workspace = true

reth-testing-utils = { workspace = true, optional = true }

# misc
thiserror.workspace = true

[features]
test-utils = ["reth-consensus/test-utils", "reth-network-p2p/test-utils"]
test-utils = ["reth-consensus/test-utils", "reth-network-p2p/test-utils", "reth-testing-utils"]
clap = ["reth-storage-errors/clap"]
5 changes: 4 additions & 1 deletion crates/interfaces/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ pub use reth_blockchain_tree_api as blockchain_tree;

/// Common test helpers for mocking out Consensus, Downloaders and Header Clients.
#[cfg(feature = "test-utils")]
pub use reth_network_p2p::test_utils;
pub mod test_utils {
pub use reth_network_p2p::test_utils::*;
pub use reth_testing_utils::generators;
}
8 changes: 1 addition & 7 deletions crates/net/p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ auto_impl.workspace = true
thiserror.workspace = true
tracing.workspace = true

secp256k1 = { workspace = true, default-features = false, features = [
"alloc",
"recovery",
"rand",
], optional = true }
parking_lot = { workspace = true, optional = true }
rand = { workspace = true, optional = true }

[dev-dependencies]
reth-consensus = { workspace = true, features = ["test-utils"] }
Expand All @@ -45,4 +39,4 @@ tokio = { workspace = true, features = ["full"] }
secp256k1 = { workspace = true, features = ["alloc", "recovery", "rand"] }

[features]
test-utils = ["reth-consensus/test-utils", "secp256k1", "rand", "parking_lot"]
test-utils = ["reth-consensus/test-utils", "parking_lot"]
3 changes: 0 additions & 3 deletions crates/net/p2p/src/test_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ mod bodies;
mod full_block;
mod headers;

/// Generators for different data structures like block headers, block bodies and ranges of those.
pub mod generators;

pub use bodies::*;
pub use full_block::*;
pub use headers::*;
7 changes: 5 additions & 2 deletions testing/testing-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ repository.workspace = true
workspace = true

[dependencies]
secp256k1.workspace = true
alloy-genesis.workspace = true
reth-primitives.workspace = true

alloy-genesis.workspace = true

secp256k1.workspace = true
rand.workspace = true
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Generators for different data structures like block headers, block bodies and ranges of those.

pub use rand::Rng;
use rand::{
distributions::uniform::SampleRange, rngs::StdRng, seq::SliceRandom, thread_rng, SeedableRng,
Expand Down
2 changes: 2 additions & 0 deletions testing/testing-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
pub mod genesis_allocator;

pub use genesis_allocator::GenesisAllocator;

pub mod generators;
Loading