chore: move generators module (#8429)

This commit is contained in:
Matthias Seitz
2024-05-28 18:04:46 +02:00
committed by GitHub
parent 911a3a4a92
commit 329634256a
8 changed files with 19 additions and 14 deletions

2
Cargo.lock generated
View File

@ -7110,6 +7110,7 @@ dependencies = [
"reth-fs-util", "reth-fs-util",
"reth-network-p2p", "reth-network-p2p",
"reth-storage-errors", "reth-storage-errors",
"reth-testing-utils",
"thiserror", "thiserror",
] ]
@ -8072,6 +8073,7 @@ name = "reth-testing-utils"
version = "0.2.0-beta.7" version = "0.2.0-beta.7"
dependencies = [ dependencies = [
"alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=64feb9b)", "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=64feb9b)",
"rand 0.8.5",
"reth-primitives", "reth-primitives",
"secp256k1 0.28.2", "secp256k1 0.28.2",
] ]

View File

@ -18,9 +18,11 @@ reth-fs-util.workspace = true
reth-network-p2p.workspace = true reth-network-p2p.workspace = true
reth-storage-errors.workspace = true reth-storage-errors.workspace = true
reth-testing-utils = { workspace = true, optional = true }
# misc # misc
thiserror.workspace = true thiserror.workspace = true
[features] [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"] clap = ["reth-storage-errors/clap"]

View File

@ -36,4 +36,7 @@ pub use reth_blockchain_tree_api as blockchain_tree;
/// Common test helpers for mocking out Consensus, Downloaders and Header Clients. /// Common test helpers for mocking out Consensus, Downloaders and Header Clients.
#[cfg(feature = "test-utils")] #[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;
}

View File

@ -28,13 +28,7 @@ auto_impl.workspace = true
thiserror.workspace = true thiserror.workspace = true
tracing.workspace = true tracing.workspace = true
secp256k1 = { workspace = true, default-features = false, features = [
"alloc",
"recovery",
"rand",
], optional = true }
parking_lot = { workspace = true, optional = true } parking_lot = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
[dev-dependencies] [dev-dependencies]
reth-consensus = { workspace = true, features = ["test-utils"] } reth-consensus = { workspace = true, features = ["test-utils"] }
@ -45,4 +39,4 @@ tokio = { workspace = true, features = ["full"] }
secp256k1 = { workspace = true, features = ["alloc", "recovery", "rand"] } secp256k1 = { workspace = true, features = ["alloc", "recovery", "rand"] }
[features] [features]
test-utils = ["reth-consensus/test-utils", "secp256k1", "rand", "parking_lot"] test-utils = ["reth-consensus/test-utils", "parking_lot"]

View File

@ -2,9 +2,6 @@ mod bodies;
mod full_block; mod full_block;
mod headers; mod headers;
/// Generators for different data structures like block headers, block bodies and ranges of those.
pub mod generators;
pub use bodies::*; pub use bodies::*;
pub use full_block::*; pub use full_block::*;
pub use headers::*; pub use headers::*;

View File

@ -12,6 +12,9 @@ repository.workspace = true
workspace = true workspace = true
[dependencies] [dependencies]
secp256k1.workspace = true
alloy-genesis.workspace = true
reth-primitives.workspace = true reth-primitives.workspace = true
alloy-genesis.workspace = true
secp256k1.workspace = true
rand.workspace = true

View File

@ -1,3 +1,5 @@
//! Generators for different data structures like block headers, block bodies and ranges of those.
pub use rand::Rng; pub use rand::Rng;
use rand::{ use rand::{
distributions::uniform::SampleRange, rngs::StdRng, seq::SliceRandom, thread_rng, SeedableRng, distributions::uniform::SampleRange, rngs::StdRng, seq::SliceRandom, thread_rng, SeedableRng,

View File

@ -11,3 +11,5 @@
pub mod genesis_allocator; pub mod genesis_allocator;
pub use genesis_allocator::GenesisAllocator; pub use genesis_allocator::GenesisAllocator;
pub mod generators;