Skip to content

Commit

Permalink
fixed imports
Browse files Browse the repository at this point in the history
  • Loading branch information
PelleKrab committed Dec 14, 2024
1 parent 1b7a953 commit 20fd296
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion crates/storage/errors/src/lockfile.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloc::string::String;
use alloc::string::{String, ToString};
use reth_fs_util::FsPathError;

/// Storage lock error.
Expand Down
50 changes: 24 additions & 26 deletions crates/storage/errors/src/provider.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::path::PathBuf;

use crate::{db::DatabaseError, lockfile::StorageLockError, writer::UnifiedStorageWriterError};
use alloc::{boxed::Box, string::String};
use alloy_eips::{BlockHashOrNumber, HashOrNumber};
Expand All @@ -19,30 +17,30 @@ pub enum ProviderError {
Database(#[from] DatabaseError),

/// RLP error.
#[error(transparent)]
#[error("{_0}")]
Rlp(alloy_rlp::Error),
/// Filesystem path error.
#[error("{0}")]
#[error("{_0}")]
FsPathError(String),

/// Nippy jar error.
#[error("nippy jar error: {0}")]
#[error("nippy jar error: {_0}")]
NippyJar(String),

/// Trie witness error.
#[error("trie witness error: {0}")]
#[error("trie witness error: {_0}")]
TrieWitnessError(String),

/// Error when recovering the sender for a transaction
#[error("failed to recover sender for transaction")]
SenderRecoveryError,

/// The header number was not found for the given block hash.
#[error("block hash {0} does not exist in Headers table")]
#[error("block hash {_0} does not exist in Headers table")]
BlockHashNotFound(BlockHash),

/// A block body is missing.
#[error("block meta not found for block #{0}")]
#[error("block meta not found for block #{_0}")]
BlockBodyIndicesNotFound(BlockNumber),

/// The transition ID was found for the given address and storage key, but the changeset was
Expand All @@ -67,19 +65,19 @@ pub enum ProviderError {
},

/// The total difficulty for a block is missing.
#[error("total difficulty not found for block #{0}")]
#[error("total difficulty not found for block #{_0}")]
TotalDifficultyNotFound(BlockNumber),

/// When required header related data was not found but was required.
#[error("no header found for {0:?}")]
#[error("no header found for {_0:?}")]
HeaderNotFound(BlockHashOrNumber),

/// The specific transaction identified by hash or id is missing.
#[error("no transaction found for {0:?}")]
#[error("no transaction found for {_0:?}")]
TransactionNotFound(HashOrNumber),

/// The specific receipt for a transaction identified by hash or id is missing
#[error("no receipt found for {0:?}")]
#[error("no receipt found for {_0:?}")]
ReceiptNotFound(HashOrNumber),

/// Unable to find the best block.
Expand All @@ -99,31 +97,31 @@ pub enum ProviderError {
CacheServiceUnavailable,

/// Thrown when we failed to lookup a block for the pending state.
#[error("unknown block {0}")]
#[error("unknown block {_0}")]
UnknownBlockHash(B256),

/// Thrown when we were unable to find a state for a block hash.
#[error("no state found for block {0}")]
#[error("no state found for block {_0}")]
StateForHashNotFound(B256),

/// Thrown when we were unable to find a state for a block number.
#[error("no state found for block number {0}")]
#[error("no state found for block number {_0}")]
StateForNumberNotFound(u64),

/// Unable to find the block number for a given transaction index.
#[error("unable to find the block number for a given transaction index")]
BlockNumberForTransactionIndexNotFound,

/// Root mismatch.
#[error("merkle trie {0}")]
#[error("merkle trie {_0}")]
StateRootMismatch(Box<RootMismatch>),

/// Root mismatch during unwind
#[error("unwind merkle trie {0}")]
#[error("unwind merkle trie {_0}")]
UnwindStateRootMismatch(Box<RootMismatch>),

/// State is not available for the given block number because it is pruned.
#[error("state at block #{0} is pruned")]
#[error("state at block #{_0} is pruned")]
StateAtBlockPruned(BlockNumber),

/// Provider does not support this particular request.
Expand All @@ -132,35 +130,35 @@ pub enum ProviderError {

/// Static File is not found at specified path.
#[cfg(feature = "std")]
#[error("not able to find {0} static file at {1:?}")]
MissingStaticFilePath(StaticFileSegment, PathBuf),
#[error("not able to find {_0} static file at {_1:?}")]
MissingStaticFilePath(StaticFileSegment, std::path::PathBuf),

/// Static File is not found for requested block.
#[error("not able to find {0} static file for block number {1}")]
#[error("not able to find {_0} static file for block number {_1}")]
MissingStaticFileBlock(StaticFileSegment, BlockNumber),

/// Static File is not found for requested transaction.
#[error("unable to find {0} static file for transaction id {1}")]
#[error("unable to find {_0} static file for transaction id {_1}")]
MissingStaticFileTx(StaticFileSegment, TxNumber),

/// Static File is finalized and cannot be written to.
#[error("unable to write block #{1} to finalized static file {0}")]
#[error("unable to write block #{_1} to finalized static file {_0}")]
FinalizedStaticFile(StaticFileSegment, BlockNumber),

/// Trying to insert data from an unexpected block number.
#[error("trying to append data to {0} as block #{1} but expected block #{2}")]
#[error("trying to append data to {_0} as block #{_1} but expected block #{_2}")]
UnexpectedStaticFileBlockNumber(StaticFileSegment, BlockNumber, BlockNumber),

/// Trying to insert data from an unexpected block number.
#[error("trying to append row to {0} at index #{1} but expected index #{2}")]
#[error("trying to append row to {_0} at index #{_1} but expected index #{_2}")]
UnexpectedStaticFileTxNumber(StaticFileSegment, TxNumber, TxNumber),

/// Static File Provider was initialized as read-only.
#[error("cannot get a writer on a read-only environment.")]
ReadOnlyStaticFileAccess,

/// Consistent view error.
#[error("failed to initialize consistent view: {0}")]
#[error("failed to initialize consistent view: {_0}")]
ConsistentView(Box<ConsistentViewError>),

/// Storage lock error.
Expand Down

0 comments on commit 20fd296

Please sign in to comment.