Skip to content

Commit

Permalink
chore: move generators module (paradigmxyz#8429)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored and mw2000 committed Jun 5, 2024
1 parent e830887 commit 080c01e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 14 deletions.
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;

0 comments on commit 080c01e

Please sign in to comment.