mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(trie): expose trie witness on proof provider (#9915)
This commit is contained in:
@ -7,6 +7,34 @@ use thiserror_no_std::Error;
|
||||
|
||||
/// State root errors.
|
||||
#[derive(Error, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum StateRootError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
Database(#[from] DatabaseError),
|
||||
/// Storage root error.
|
||||
#[error(transparent)]
|
||||
StorageRootError(#[from] StorageRootError),
|
||||
}
|
||||
|
||||
impl From<StateRootError> for DatabaseError {
|
||||
fn from(err: StateRootError) -> Self {
|
||||
match err {
|
||||
StateRootError::Database(err) |
|
||||
StateRootError::StorageRootError(StorageRootError::Database(err)) => err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Storage root error.
|
||||
#[derive(Error, PartialEq, Eq, Clone, Debug)]
|
||||
pub enum StorageRootError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
Database(#[from] DatabaseError),
|
||||
}
|
||||
|
||||
/// State proof errors.
|
||||
#[derive(Error, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum StateProofError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
@ -45,30 +73,8 @@ pub enum TrieWitnessError {
|
||||
MissingTargetNode(Nibbles),
|
||||
}
|
||||
|
||||
/// State root errors.
|
||||
#[derive(Error, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum StateRootError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
Database(#[from] DatabaseError),
|
||||
/// Storage root error.
|
||||
#[error(transparent)]
|
||||
StorageRootError(#[from] StorageRootError),
|
||||
}
|
||||
|
||||
impl From<StateRootError> for DatabaseError {
|
||||
fn from(err: StateRootError) -> Self {
|
||||
match err {
|
||||
StateRootError::Database(err) |
|
||||
StateRootError::StorageRootError(StorageRootError::Database(err)) => err,
|
||||
}
|
||||
impl From<TrieWitnessError> for ProviderError {
|
||||
fn from(value: TrieWitnessError) -> Self {
|
||||
Self::TrieWitnessError(value.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
/// Storage root error.
|
||||
#[derive(Error, PartialEq, Eq, Clone, Debug)]
|
||||
pub enum StorageRootError {
|
||||
/// Internal database error.
|
||||
#[error(transparent)]
|
||||
Database(#[from] DatabaseError),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user