Skip to content

Commit

Permalink
chore: rm reth-interfaces (#8486)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored May 29, 2024
1 parent bab8aaa commit 42667e1
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 112 deletions.
15 changes: 0 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ members = [
"crates/evm/execution-errors",
"crates/evm/execution-types",
"crates/exex/",
"crates/interfaces/",
"crates/metrics/",
"crates/metrics/metrics-derive/",
"crates/net/common/",
Expand Down Expand Up @@ -253,7 +252,6 @@ reth-execution-errors = { path = "crates/evm/execution-errors" }
reth-execution-types = { path = "crates/evm/execution-types" }
reth-exex = { path = "crates/exex" }
reth-fs-util = { path = "crates/fs-util" }
reth-interfaces = { path = "crates/interfaces" }
reth-ipc = { path = "crates/rpc/ipc" }
reth-libmdbx = { path = "crates/storage/libmdbx-rs" }
reth-mdbx-sys = { path = "crates/storage/libmdbx-rs/mdbx-sys" }
Expand Down
24 changes: 0 additions & 24 deletions crates/interfaces/Cargo.toml

This file was deleted.

41 changes: 0 additions & 41 deletions crates/interfaces/src/lib.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/rpc/rpc-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ tracing.workspace = true

[dev-dependencies]
reth-beacon-consensus.workspace = true
reth-interfaces = { workspace = true, features = ["test-utils"] }
reth-network-api.workspace = true
reth-evm-ethereum.workspace = true
reth-ethereum-engine-primitives.workspace = true
Expand Down
1 change: 0 additions & 1 deletion crates/storage/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ once_cell.workspace = true
# reth libs with arbitrary
reth-primitives = { workspace = true, features = ["arbitrary"] }
reth-codecs.workspace = true
reth-interfaces.workspace = true

rand.workspace = true
serde_json.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion testing/ef-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ reth-primitives.workspace = true
reth-db = { workspace = true, features = ["mdbx", "test-utils"] }
reth-provider = { workspace = true, features = ["test-utils"] }
reth-stages.workspace = true
reth-interfaces.workspace = true
reth-evm-ethereum.workspace = true

alloy-rlp.workspace = true

walkdir = "2.3.3"
serde.workspace = true
serde_json.workspace = true
Expand Down
43 changes: 18 additions & 25 deletions testing/ef-tests/src/cases/blockchain_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,20 @@ impl Case for BlockchainTestCase {
db.as_ref(),
Arc::new(case.network.clone().into()),
static_files_dir_path,
)
.map_err(|err| Error::RethError(err.into()))?
)?
.provider_rw()
.unwrap();

// Insert initial test state into the provider.
provider
.insert_historical_block(
SealedBlock::new(
case.genesis_block_header.clone().into(),
BlockBody::default(),
)
.try_seal_with_senders()
.unwrap(),
None,
provider.insert_historical_block(
SealedBlock::new(
case.genesis_block_header.clone().into(),
BlockBody::default(),
)
.map_err(|err| Error::RethError(err.into()))?;
.try_seal_with_senders()
.unwrap(),
None,
)?;
case.pre.write_to_db(provider.tx_ref())?;

// Initialize receipts static file with genesis
Expand All @@ -119,12 +116,10 @@ impl Case for BlockchainTestCase {
// Decode and insert blocks, creating a chain of blocks for the test case.
let last_block = case.blocks.iter().try_fold(None, |_, block| {
let decoded = SealedBlock::decode(&mut block.rlp.as_ref())?;
provider
.insert_historical_block(
decoded.clone().try_seal_with_senders().unwrap(),
None,
)
.map_err(|err| Error::RethError(err.into()))?;
provider.insert_historical_block(
decoded.clone().try_seal_with_senders().unwrap(),
None,
)?;
Ok::<Option<SealedBlock>, Error>(Some(decoded))
})?;
provider
Expand Down Expand Up @@ -157,13 +152,11 @@ impl Case for BlockchainTestCase {
(None, Some(expected_state_root)) => {
// Insert state hashes into the provider based on the expected state root.
let last_block = last_block.unwrap_or_default();
provider
.insert_hashes(
0..=last_block.number,
last_block.hash(),
*expected_state_root,
)
.map_err(|err| Error::RethError(err.into()))?;
provider.insert_hashes(
0..=last_block.number,
last_block.hash(),
*expected_state_root,
)?;
}
_ => return Err(Error::MissingPostState),
}
Expand Down
4 changes: 2 additions & 2 deletions testing/ef-tests/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use crate::Case;
use reth_db::DatabaseError;
use reth_interfaces::RethError;
use reth_provider::ProviderError;
use std::path::{Path, PathBuf};
use thiserror::Error;

Expand Down Expand Up @@ -46,7 +46,7 @@ pub enum Error {
Assertion(String),
/// An error internally in reth occurred.
#[error("test failed: {0}")]
RethError(#[from] RethError),
Provider(#[from] ProviderError),
/// An error occurred while decoding RLP.
#[error("an error occurred deserializing RLP: {0}")]
RlpDecodeError(#[from] alloy_rlp::Error),
Expand Down

0 comments on commit 42667e1

Please sign in to comment.