EvmError

Trait EvmError 

Source
pub trait EvmError:
    Sized
    + Error
    + Send
    + Sync
    + 'static {
    type InvalidTransaction: InvalidTxError;

    // Required methods
    fn as_invalid_tx_err(&self) -> Option<&Self::InvalidTransaction>;
    fn try_into_invalid_tx_err(self) -> Result<Self::InvalidTransaction, Self>;

    // Provided method
    fn is_invalid_tx_err(&self) -> bool { ... }
}
Expand description

Abstraction over errors that can occur during EVM execution.

It’s assumed that errors can occur either because of an invalid transaction, meaning that other transaction might still result in successful execution, or because of a general EVM misconfiguration.

If caller occurs a error different from EvmError::InvalidTransaction, it should most likely be treated as fatal error flagging some EVM misconfiguration.

Required Associated Types§

Source

type InvalidTransaction: InvalidTxError

Errors which might occur as a result of an invalid transaction. i.e unrelated to general EVM configuration.

Required Methods§

Source

fn as_invalid_tx_err(&self) -> Option<&Self::InvalidTransaction>

Returns the EvmError::InvalidTransaction if the error is an invalid transaction error.

Source

fn try_into_invalid_tx_err(self) -> Result<Self::InvalidTransaction, Self>

Attempts to convert the error into EvmError::InvalidTransaction.

Provided Methods§

Source

fn is_invalid_tx_err(&self) -> bool

Returns true if the error is an invalid transaction error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<DBError, TxError> EvmError for EVMError<DBError, TxError>
where DBError: Error + Send + Sync + 'static, TxError: InvalidTxError,

Implementors§