Skip to content

Commit

Permalink
Check features powerset in reth-codecs (paradigmxyz#10134)
Browse files Browse the repository at this point in the history
  • Loading branch information
citizen-stig authored Aug 6, 2024
1 parent 199f728 commit f4e6a09
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ revm-primitives = { version = "7.1.0", features = [
# eth
alloy-chains = "0.1.18"
alloy-dyn-abi = "0.7.2"
alloy-primitives = "0.7.2"
alloy-primitives = { version = "0.7.2", default-features = false }
alloy-rlp = "0.3.4"
alloy-sol-types = "0.7.2"
alloy-trie = { version = "0.4", default-features = false }
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,8 @@ pr:
make lint && \
make update-book-cli && \
make test

check-features:
cargo hack check \
--package reth-codecs \
--feature-powerset
3 changes: 2 additions & 1 deletion crates/storage/codecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ proptest-arbitrary-interop.workspace = true

[features]
default = ["std", "alloy"]
std = ["alloy-primitives/std", "bytes/std", "serde/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",
"dep:serde"
]
3 changes: 3 additions & 0 deletions crates/storage/codecs/src/alloy/access_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ use crate::Compact;
use alloy_eips::eip2930::{AccessList, AccessListItem};
use alloy_primitives::Address;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// Implement `Compact` for `AccessListItem` and `AccessList`.
impl Compact for AccessListItem {
fn to_compact<B>(&self, buf: &mut B) -> usize
Expand Down
3 changes: 3 additions & 0 deletions crates/storage/codecs/src/alloy/genesis_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use alloy_primitives::{Bytes, B256, U256};
use reth_codecs_derive::reth_codec;
use serde::{Deserialize, Serialize};

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// GenesisAccount acts as bridge which simplifies Compact implementation for AlloyGenesisAccount.
///
/// Notice: Make sure this struct is 1:1 with `alloy_genesis::GenesisAccount`
Expand Down
3 changes: 3 additions & 0 deletions crates/storage/codecs/src/alloy/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use crate::Compact;
use alloy_primitives::{Address, Bytes, Log, LogData};
use bytes::BufMut;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// Implement `Compact` for `LogData` and `Log`.
impl Compact for LogData {
fn to_compact<B>(&self, buf: &mut B) -> usize
Expand Down
3 changes: 3 additions & 0 deletions crates/storage/codecs/src/alloy/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ use alloy_primitives::B256;
use alloy_trie::{hash_builder::HashBuilderValue, BranchNodeCompact, TrieMask};
use bytes::{Buf, BufMut};

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

impl Compact for HashBuilderValue {
fn to_compact<B>(&self, buf: &mut B) -> usize
where
Expand Down

0 comments on commit f4e6a09

Please sign in to comment.