chore: make alloy impls feature gated (#7747)

This commit is contained in:
Matthias Seitz
2024-04-19 17:18:43 +02:00
committed by GitHub
parent d214daebbd
commit bd4757b3b5
6 changed files with 16 additions and 8 deletions

View File

@ -13,15 +13,16 @@ workspace = true
[dependencies]
reth-codecs-derive = { path = "./derive", default-features = false }
alloy-eips.workspace = true
alloy-eips = { workspace = true, optional = true }
alloy-primitives.workspace = true
bytes.workspace = true
[dev-dependencies]
alloy-eips = { workspace = true, features = ["arbitrary", "serde"] }
alloy-eips = { workspace = true, default-features = false, features = ["arbitrary", "serde"] }
alloy-primitives = { workspace = true, features = ["arbitrary", "serde"] }
serde.workspace = true
modular-bitfield = "0.11.2"
modular-bitfield.workspace = true
test-fuzz.workspace = true
serde_json.workspace = true
@ -30,6 +31,7 @@ proptest.workspace = true
proptest-derive.workspace = true
[features]
default = ["std"]
default = ["std", "alloy"]
std = ["alloy-primitives/std", "bytes/std"]
alloy = ["alloy-eips"]
optimism = ["reth-codecs-derive/optimism"]

View File

@ -1,4 +1,8 @@
//! Compact codec.
//!
//! ## Feature Flags
//!
//! - `alloy`: [Compact] implementation for various alloy types.
#![doc(
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
@ -16,6 +20,7 @@ pub use reth_codecs_derive::*;
use alloy_primitives::{Address, Bloom, Bytes, B256, B512, U256};
use bytes::Buf;
#[cfg(any(test, feature = "alloy"))]
mod alloy;
/// Trait that implements the `Compact` codec.

View File

@ -23,7 +23,7 @@ reth-tracing.workspace = true
# codecs
serde = { workspace = true, default-features = false }
parity-scale-codec = { version = "3.2.1", features = ["bytes"] }
modular-bitfield = "0.11.2"
modular-bitfield.workspace = true
# metrics
reth-metrics.workspace = true