mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: rm reth-interfaces (#8486)
This commit is contained in:
15
Cargo.lock
generated
15
Cargo.lock
generated
@ -2700,7 +2700,6 @@ dependencies = [
|
||||
"rayon",
|
||||
"reth-db",
|
||||
"reth-evm-ethereum",
|
||||
"reth-interfaces",
|
||||
"reth-primitives",
|
||||
"reth-provider",
|
||||
"reth-stages",
|
||||
@ -6671,7 +6670,6 @@ dependencies = [
|
||||
"rand 0.8.5",
|
||||
"reth-codecs",
|
||||
"reth-fs-util",
|
||||
"reth-interfaces",
|
||||
"reth-libmdbx",
|
||||
"reth-metrics",
|
||||
"reth-nippy-jar",
|
||||
@ -7107,18 +7105,6 @@ dependencies = [
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reth-interfaces"
|
||||
version = "0.2.0-beta.7"
|
||||
dependencies = [
|
||||
"reth-blockchain-tree-api",
|
||||
"reth-errors",
|
||||
"reth-execution-errors",
|
||||
"reth-network-p2p",
|
||||
"reth-storage-errors",
|
||||
"reth-testing-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reth-ipc"
|
||||
version = "0.2.0-beta.7"
|
||||
@ -7834,7 +7820,6 @@ dependencies = [
|
||||
"reth-ethereum-engine-primitives",
|
||||
"reth-evm",
|
||||
"reth-evm-ethereum",
|
||||
"reth-interfaces",
|
||||
"reth-ipc",
|
||||
"reth-metrics",
|
||||
"reth-network-api",
|
||||
|
||||
@ -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/",
|
||||
@ -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" }
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
[package]
|
||||
name = "reth-interfaces"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
reth-blockchain-tree-api.workspace = true
|
||||
reth-execution-errors.workspace = true
|
||||
reth-network-p2p.workspace = true
|
||||
reth-storage-errors.workspace = true
|
||||
reth-errors.workspace = true
|
||||
|
||||
reth-testing-utils = { workspace = true, optional = true }
|
||||
|
||||
[features]
|
||||
test-utils = ["reth-network-p2p/test-utils", "reth-testing-utils"]
|
||||
clap = ["reth-storage-errors/clap"]
|
||||
@ -1,41 +0,0 @@
|
||||
//! A collection of shared traits and error types used in Reth.
|
||||
//!
|
||||
//! ## Feature Flags
|
||||
//!
|
||||
//! - `test-utils`: Export utilities for testing
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
|
||||
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
|
||||
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
|
||||
)]
|
||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
/// Storage error types
|
||||
pub use reth_storage_errors::{db, provider};
|
||||
|
||||
/// Block Execution traits.
|
||||
pub use reth_execution_errors as executor;
|
||||
|
||||
/// Possible errors when interacting with the chain.
|
||||
pub use reth_errors::{RethError, RethResult};
|
||||
|
||||
/// P2P traits.
|
||||
pub use reth_network_p2p as p2p;
|
||||
|
||||
/// Trie error
|
||||
pub use reth_execution_errors::trie;
|
||||
|
||||
/// Syncing related traits.
|
||||
pub use reth_network_p2p::sync;
|
||||
|
||||
/// BlockchainTree related traits.
|
||||
pub use reth_blockchain_tree_api as blockchain_tree;
|
||||
|
||||
/// Common test helpers for mocking out Consensus, Downloaders and Header Clients.
|
||||
#[cfg(feature = "test-utils")]
|
||||
pub mod test_utils {
|
||||
pub use reth_network_p2p::test_utils::*;
|
||||
pub use reth_testing_utils::generators;
|
||||
}
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -87,14 +87,12 @@ 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(
|
||||
provider.insert_historical_block(
|
||||
SealedBlock::new(
|
||||
case.genesis_block_header.clone().into(),
|
||||
BlockBody::default(),
|
||||
@ -102,8 +100,7 @@ impl Case for BlockchainTestCase {
|
||||
.try_seal_with_senders()
|
||||
.unwrap(),
|
||||
None,
|
||||
)
|
||||
.map_err(|err| Error::RethError(err.into()))?;
|
||||
)?;
|
||||
case.pre.write_to_db(provider.tx_ref())?;
|
||||
|
||||
// Initialize receipts static file with genesis
|
||||
@ -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(
|
||||
provider.insert_historical_block(
|
||||
decoded.clone().try_seal_with_senders().unwrap(),
|
||||
None,
|
||||
)
|
||||
.map_err(|err| Error::RethError(err.into()))?;
|
||||
)?;
|
||||
Ok::<Option<SealedBlock>, Error>(Some(decoded))
|
||||
})?;
|
||||
provider
|
||||
@ -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(
|
||||
provider.insert_hashes(
|
||||
0..=last_block.number,
|
||||
last_block.hash(),
|
||||
*expected_state_root,
|
||||
)
|
||||
.map_err(|err| Error::RethError(err.into()))?;
|
||||
)?;
|
||||
}
|
||||
_ => return Err(Error::MissingPostState),
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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),
|
||||
|
||||
Reference in New Issue
Block a user