chore: extract provider types (#8372)

This commit is contained in:
Matthias Seitz
2024-05-23 21:24:23 +02:00
committed by GitHub
parent 8263480a72
commit 1287bbcac7
8 changed files with 53 additions and 8 deletions

12
Cargo.lock generated
View File

@ -7030,7 +7030,6 @@ name = "reth-interfaces"
version = "0.2.0-beta.7"
dependencies = [
"auto_impl",
"clap",
"futures",
"parking_lot 0.12.2",
"rand 0.8.5",
@ -7040,6 +7039,7 @@ dependencies = [
"reth-network-api",
"reth-network-types",
"reth-primitives",
"reth-storage-errors",
"secp256k1 0.28.2",
"thiserror",
"tokio",
@ -7939,6 +7939,16 @@ dependencies = [
"strum",
]
[[package]]
name = "reth-storage-errors"
version = "0.2.0-beta.7"
dependencies = [
"clap",
"reth-fs-util",
"reth-primitives",
"thiserror",
]
[[package]]
name = "reth-tasks"
version = "0.2.0-beta.7"

View File

@ -64,6 +64,7 @@ members = [
"crates/storage/codecs/",
"crates/storage/codecs/derive/",
"crates/storage/db/",
"crates/storage/errors/",
"crates/storage/libmdbx-rs/",
"crates/storage/libmdbx-rs/mdbx-sys/",
"crates/storage/nippy-jar/",
@ -275,6 +276,7 @@ reth-stages = { path = "crates/stages" }
reth-stages-api = { path = "crates/stages-api" }
reth-static-file = { path = "crates/static-file" }
reth-static-file-types = { path = "crates/static-file-types" }
reth-storage-errors = { path = "crates/storage/errors" }
reth-tasks = { path = "crates/tasks" }
reth-testing-utils = { path = "testing/testing-utils" }
reth-tokio-util = { path = "crates/tokio-util" }

View File

@ -17,6 +17,7 @@ reth-network-api.workspace = true
reth-eth-wire-types.workspace = true
reth-consensus.workspace = true
reth-network-types.workspace = true
reth-storage-errors.workspace = true
# async
futures.workspace = true
@ -31,7 +32,6 @@ secp256k1 = { workspace = true, default-features = false, features = [
"recovery",
"rand",
], optional = true }
clap = { workspace = true, features = ["derive"], optional = true }
parking_lot = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
@ -45,5 +45,5 @@ secp256k1 = { workspace = true, features = ["alloc", "recovery", "rand"] }
[features]
test-utils = ["reth-consensus/test-utils", "secp256k1", "rand", "parking_lot"]
cli = ["clap"]
clap = ["reth-storage-errors/clap"]
optimism = ["reth-eth-wire-types/optimism"]

View File

@ -12,8 +12,8 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
/// Database error
pub mod db;
/// Storage error types
pub use reth_storage_errors::{db, provider};
/// Block Execution traits.
pub mod executor;
@ -28,9 +28,6 @@ pub mod p2p;
/// Trie error
pub mod trie;
/// Provider error
pub mod provider;
/// Syncing related traits.
pub mod sync;

View File

@ -0,0 +1,21 @@
[package]
name = "reth-storage-errors"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
[lints]
workspace = true
[dependencies]
reth-primitives.workspace = true
reth-fs-util.workspace = true
thiserror.workspace = true
clap = { workspace = true, features = ["derive"], optional = true }
[features]
clap = ["dep:clap"]

View File

@ -0,0 +1,15 @@
//! Commonly used error types used when interacting with storage.
#![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))]
/// Database error
pub mod db;
/// Provider error
pub mod provider;