chore: remove reth-codec dependency from ethereum-forks crate (#6055)

This commit is contained in:
galois
2024-01-15 17:14:12 +08:00
committed by GitHub
parent 6fb67172fd
commit 5354c50445
3 changed files with 7 additions and 8 deletions

1
Cargo.lock generated
View File

@@ -6121,7 +6121,6 @@ dependencies = [
"proptest",
"proptest-derive",
"rand 0.8.5",
"reth-codecs",
"serde",
"thiserror",
]

View File

@@ -12,9 +12,6 @@ description = "Ethereum fork types used in reth."
workspace = true
[dependencies]
# reth
reth-codecs.workspace = true
# ethereum
alloy-chains.workspace = true
alloy-primitives = { workspace = true, features = ["rand", "rlp"] }
@@ -42,4 +39,4 @@ proptest-derive.workspace = true
[features]
arbitrary = ["dep:arbitrary", "dep:proptest", "dep:proptest-derive"]
optimism = ["reth-codecs/optimism"]
optimism = []

View File

@@ -5,8 +5,11 @@
use crate::Head;
use alloy_primitives::{hex, BlockNumber, B256};
use alloy_rlp::*;
#[cfg(any(test, feature = "arbitrary"))]
use arbitrary::Arbitrary;
use crc::*;
use reth_codecs::derive_arbitrary;
#[cfg(any(test, feature = "arbitrary"))]
use proptest_derive::Arbitrary as PropTestArbitrary;
use serde::{Deserialize, Serialize};
use std::{
cmp::Ordering,
@@ -19,7 +22,7 @@ use thiserror::Error;
const CRC_32_IEEE: Crc<u32> = Crc::<u32>::new(&CRC_32_ISO_HDLC);
/// `CRC32` hash of all previous forks starting from genesis block.
#[derive_arbitrary(rlp)]
#[cfg_attr(any(test, feature = "arbitrary"), derive(PropTestArbitrary, Arbitrary))]
#[derive(
Clone,
Copy,
@@ -108,7 +111,7 @@ impl From<ForkFilterKey> for u64 {
/// A fork identifier as defined by EIP-2124.
/// Serves as the chain compatibility identifier.
#[derive_arbitrary(rlp)]
#[cfg_attr(any(test, feature = "arbitrary"), derive(PropTestArbitrary, Arbitrary))]
#[derive(
Clone,
Copy,