mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: make blockchain tree error results more specific (#7237)
This commit is contained in:
@ -1,29 +0,0 @@
|
||||
use thiserror::Error;
|
||||
|
||||
/// State root error.
|
||||
#[derive(Error, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum StateRootError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
DB(#[from] reth_db::DatabaseError),
|
||||
/// Storage root error.
|
||||
#[error(transparent)]
|
||||
StorageRootError(#[from] StorageRootError),
|
||||
}
|
||||
|
||||
impl From<StateRootError> for reth_db::DatabaseError {
|
||||
fn from(err: StateRootError) -> Self {
|
||||
match err {
|
||||
StateRootError::DB(err) => err,
|
||||
StateRootError::StorageRootError(StorageRootError::DB(err)) => err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Storage root error.
|
||||
#[derive(Error, PartialEq, Eq, Clone, Debug)]
|
||||
pub enum StorageRootError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
DB(#[from] reth_db::DatabaseError),
|
||||
}
|
||||
@ -26,9 +26,6 @@ pub mod hashed_cursor;
|
||||
/// The trie walker for iterating over the trie nodes.
|
||||
pub mod walker;
|
||||
|
||||
mod errors;
|
||||
pub use errors::*;
|
||||
|
||||
/// The iterators for traversing existing intermediate hashes and updated trie leaves.
|
||||
pub mod node_iter;
|
||||
|
||||
|
||||
@ -4,10 +4,10 @@ use crate::{
|
||||
prefix_set::PrefixSetMut,
|
||||
trie_cursor::{DatabaseAccountTrieCursor, DatabaseStorageTrieCursor},
|
||||
walker::TrieWalker,
|
||||
StateRootError, StorageRootError,
|
||||
};
|
||||
use alloy_rlp::{BufMut, Encodable};
|
||||
use reth_db::{tables, transaction::DbTx};
|
||||
use reth_interfaces::trie::{StateRootError, StorageRootError};
|
||||
use reth_primitives::{
|
||||
constants::EMPTY_ROOT_HASH,
|
||||
keccak256,
|
||||
|
||||
@ -2,7 +2,7 @@ use crate::{
|
||||
hashed_cursor::HashedPostStateCursorFactory,
|
||||
prefix_set::{PrefixSetMut, TriePrefixSets},
|
||||
updates::TrieUpdates,
|
||||
StateRoot, StateRootError,
|
||||
StateRoot,
|
||||
};
|
||||
use reth_db::{
|
||||
cursor::DbCursorRO,
|
||||
@ -11,6 +11,7 @@ use reth_db::{
|
||||
transaction::DbTx,
|
||||
DatabaseError,
|
||||
};
|
||||
use reth_interfaces::trie::StateRootError;
|
||||
use reth_primitives::{
|
||||
keccak256, revm::compat::into_reth_acc, trie::Nibbles, Account, Address, BlockNumber, B256,
|
||||
U256,
|
||||
|
||||
@ -7,10 +7,10 @@ use crate::{
|
||||
trie_cursor::TrieCursorFactory,
|
||||
updates::{TrieKey, TrieOp, TrieUpdates},
|
||||
walker::TrieWalker,
|
||||
StateRootError, StorageRootError,
|
||||
};
|
||||
use alloy_rlp::{BufMut, Encodable};
|
||||
use reth_db::transaction::DbTx;
|
||||
use reth_interfaces::trie::{StateRootError, StorageRootError};
|
||||
use reth_primitives::{
|
||||
constants::EMPTY_ROOT_HASH,
|
||||
keccak256,
|
||||
|
||||
Reference in New Issue
Block a user