From 4a004f5771706132975d40ae0130622e083c8280 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 17 Jul 2024 18:44:34 +0200 Subject: [PATCH] chore: touchups --- Cargo.toml | 2 +- crates/primitives-traits/Cargo.toml | 3 +++ crates/primitives-traits/src/constants/gas_units.rs | 5 +---- crates/primitives-traits/src/lib.rs | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c0d952fbb4cab..ced891d76db18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -340,7 +340,7 @@ reth-payload-builder = { path = "crates/payload/builder" } reth-payload-primitives = { path = "crates/payload/primitives" } reth-payload-validator = { path = "crates/payload/validator" } reth-primitives = { path = "crates/primitives" } -reth-primitives-traits = { path = "crates/primitives-traits" } +reth-primitives-traits = { path = "crates/primitives-traits", default-features = false } reth-provider = { path = "crates/storage/provider" } reth-prune = { path = "crates/prune/prune" } reth-prune-types = { path = "crates/prune/types" } diff --git a/crates/primitives-traits/Cargo.toml b/crates/primitives-traits/Cargo.toml index 638cdccc6134c..16c03465415b4 100644 --- a/crates/primitives-traits/Cargo.toml +++ b/crates/primitives-traits/Cargo.toml @@ -40,6 +40,8 @@ proptest = { workspace = true, optional = true } proptest-arbitrary-interop = { workspace = true, optional = true } [dev-dependencies] +alloy-primitives = { workspace = true, features = ["arbitrary"] } +alloy-consensus = { workspace = true, features = ["arbitrary"] } arbitrary = { workspace = true, features = ["derive"] } proptest.workspace = true proptest-arbitrary-interop.workspace = true @@ -54,6 +56,7 @@ std = ["thiserror-no-std/std"] test-utils = ["arbitrary"] arbitrary = [ "alloy-consensus/arbitrary", + "alloy-primitives/arbitrary", "dep:arbitrary", "dep:proptest", "dep:proptest-arbitrary-interop", diff --git a/crates/primitives-traits/src/constants/gas_units.rs b/crates/primitives-traits/src/constants/gas_units.rs index 932a931fc5309..ed287e6d299b1 100644 --- a/crates/primitives-traits/src/constants/gas_units.rs +++ b/crates/primitives-traits/src/constants/gas_units.rs @@ -1,8 +1,5 @@ -#[cfg(feature = "std")] -use std::time::Duration; - -#[cfg(not(feature = "std"))] use core::time::Duration; + #[cfg(not(feature = "std"))] use alloc::string::String; diff --git a/crates/primitives-traits/src/lib.rs b/crates/primitives-traits/src/lib.rs index 635649802c96d..6421e99b0d3c5 100644 --- a/crates/primitives-traits/src/lib.rs +++ b/crates/primitives-traits/src/lib.rs @@ -7,15 +7,15 @@ )] #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -// #![cfg_attr(not(feature = "std"), no_std)] - -#[cfg(feature = "alloy-compat")] -mod alloy_compat; +#![cfg_attr(not(feature = "std"), no_std)] #[cfg(not(feature = "std"))] #[macro_use] extern crate alloc; +#[cfg(feature = "alloy-compat")] +mod alloy_compat; + /// Common constants. pub mod constants; pub use constants::gas_units::{format_gas, format_gas_throughput};