chore: no_std in reth-codec (#9587)

This commit is contained in:
nk_ysg
2024-07-18 01:24:06 +08:00
committed by GitHub
parent 84174737f9
commit a627dcd9bf
3 changed files with 10 additions and 4 deletions

View File

@ -390,7 +390,7 @@ alloy-primitives = "0.7.2"
alloy-dyn-abi = "0.7.2"
alloy-sol-types = "0.7.2"
alloy-rlp = "0.3.4"
alloy-trie = "0.4"
alloy-trie = { version = "0.4", default-features = false }
alloy-rpc-types = { version = "0.2", default-features = false, features = [
"eth",
] }

View File

@ -19,12 +19,12 @@ alloy-consensus = { workspace = true, optional = true }
alloy-eips = { workspace = true, optional = true }
alloy-genesis = { workspace = true, optional = true }
alloy-primitives.workspace = true
alloy-trie.workspace = true
alloy-trie = { workspace = true, optional = true }
# misc
bytes.workspace = true
modular-bitfield = { workspace = true, optional = true }
serde.workspace = true
serde = { workspace = true, optional = true }
[dev-dependencies]
alloy-eips = { workspace = true, default-features = false, features = [
@ -43,10 +43,11 @@ proptest-arbitrary-interop.workspace = true
[features]
default = ["std", "alloy"]
std = ["alloy-primitives/std", "bytes/std"]
std = ["alloy-primitives/std", "bytes/std", "serde/std"]
alloy = [
"dep:alloy-consensus",
"dep:alloy-eips",
"dep:alloy-genesis",
"dep:modular-bitfield",
"dep:alloy-trie",
]

View File

@ -22,6 +22,11 @@ pub use reth_codecs_derive::*;
use alloy_primitives::{Address, Bloom, Bytes, FixedBytes, U256};
use bytes::Buf;
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
#[cfg(any(test, feature = "alloy"))]
mod alloy;