mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(trie): multiproof (#9804)
This commit is contained in:
@ -17,6 +17,7 @@ reth-storage-errors.workspace = true
|
||||
reth-prune-types.workspace = true
|
||||
|
||||
alloy-primitives.workspace = true
|
||||
alloy-rlp.workspace = true
|
||||
alloy-eips.workspace = true
|
||||
revm-primitives.workspace = true
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ use revm_primitives::EVMError;
|
||||
use alloc::{boxed::Box, string::String};
|
||||
|
||||
pub mod trie;
|
||||
pub use trie::{StateRootError, StorageRootError};
|
||||
pub use trie::*;
|
||||
|
||||
/// Transaction validation errors
|
||||
#[derive(thiserror_no_std::Error, Debug, Clone, PartialEq, Eq)]
|
||||
|
||||
@ -1,14 +1,34 @@
|
||||
//! Errors when computing the state root.
|
||||
|
||||
use reth_storage_errors::db::DatabaseError;
|
||||
use reth_storage_errors::{db::DatabaseError, provider::ProviderError};
|
||||
use thiserror_no_std::Error;
|
||||
|
||||
/// State root errors.
|
||||
#[derive(Error, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum StateProofError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
Database(#[from] DatabaseError),
|
||||
/// RLP decoding error.
|
||||
#[error(transparent)]
|
||||
Rlp(#[from] alloy_rlp::Error),
|
||||
}
|
||||
|
||||
impl From<StateProofError> for ProviderError {
|
||||
fn from(value: StateProofError) -> Self {
|
||||
match value {
|
||||
StateProofError::Database(error) => Self::Database(error),
|
||||
StateProofError::Rlp(error) => Self::Rlp(error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// State root errors.
|
||||
#[derive(Error, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum StateRootError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
DB(#[from] DatabaseError),
|
||||
Database(#[from] DatabaseError),
|
||||
/// Storage root error.
|
||||
#[error(transparent)]
|
||||
StorageRootError(#[from] StorageRootError),
|
||||
@ -17,8 +37,8 @@ pub enum StateRootError {
|
||||
impl From<StateRootError> for DatabaseError {
|
||||
fn from(err: StateRootError) -> Self {
|
||||
match err {
|
||||
StateRootError::DB(err) |
|
||||
StateRootError::StorageRootError(StorageRootError::DB(err)) => err,
|
||||
StateRootError::Database(err) |
|
||||
StateRootError::StorageRootError(StorageRootError::Database(err)) => err,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -28,5 +48,5 @@ impl From<StateRootError> for DatabaseError {
|
||||
pub enum StorageRootError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
DB(#[from] DatabaseError),
|
||||
Database(#[from] DatabaseError),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user