[package]
name = "reth-codecs"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
description = "Compact codec trait and implementations for Ethereum types."

[lints]
workspace = true

[dependencies]
# reth
reth-codecs-derive.workspace = true
reth-zstd-compressors = { workspace = true, optional = true, default-features = false }

# eth
alloy-consensus = { workspace = true, optional = true }
alloy-eips = { workspace = true, optional = true, features = ["serde"] }
alloy-genesis = { workspace = true, optional = true }
alloy-primitives.workspace = true
alloy-trie = { workspace = true, optional = true }

# misc
bytes.workspace = true
modular-bitfield.workspace = true
parity-scale-codec = { workspace = true, optional = true }
visibility = { workspace = true, optional = true }
serde.workspace = true
arbitrary = { workspace = true, features = ["derive"], optional = true }

[dev-dependencies]
alloy-eips = { workspace = true, default-features = false, features = ["arbitrary", "serde"] }
alloy-primitives = { workspace = true, features = ["arbitrary", "serde", "rand"] }
alloy-consensus = { workspace = true, features = ["arbitrary"] }
test-fuzz.workspace = true
serde_json.workspace = true

arbitrary = { workspace = true, features = ["derive"] }
proptest.workspace = true
proptest-arbitrary-interop.workspace = true
rstest.workspace = true

[features]
default = ["std", "alloy"]
std = [
    "alloy-primitives/std",
    "bytes/std",
    "alloy-consensus?/std",
    "alloy-eips?/std",
    "alloy-genesis?/std",
    "alloy-trie?/std",
    "serde/std",
    "reth-zstd-compressors?/std",
    "dep:parity-scale-codec",
]
alloy = [
    "dep:alloy-consensus",
    "dep:alloy-eips",
    "dep:alloy-genesis",
    "dep:alloy-trie",
    "dep:reth-zstd-compressors",
]
test-utils = [
    "std",
    "alloy",
    "arbitrary",
    "dep:visibility",
    "dep:arbitrary",
]
serde = [
    "alloy-consensus?/serde",
    "alloy-eips?/serde",
    "alloy-primitives/serde",
    "alloy-trie?/serde",
    "bytes/serde",
]
arbitrary = [
    "alloy-consensus?/arbitrary",
    "alloy-eips?/arbitrary",
    "alloy-primitives/arbitrary",
    "alloy-trie?/arbitrary",
]
