Type Alias EvmErrored

Source
pub type EvmErrored<Db, Insp = NoOpInspector, E = EVMError<<Db as Database>::Error>> = Trevm<Db, Insp, ErroredState<E>>;
Expand description

A Trevm that encountered an error during transaction execution.

Expected continuations include:

Aliased Type§

pub struct EvmErrored<Db, Insp = NoOpInspector, E = EVMError<<Db as Database>::Error>> { /* private fields */ }

Implementations§

Source§

impl<Db, Insp, E> EvmErrored<Db, Insp, E>
where Db: Database, Insp: Inspector<Ctx<Db>>,

Source

pub const fn error(&self) -> &E

Get a reference to the error.

Source

pub fn inspect_err<F, T>(&self, f: F) -> T
where F: FnOnce(&E) -> T,

Inspect the error with a closure.

Source

pub fn discard_error(self) -> EvmNeedsTx<Db, Insp>

Discard the error and return the EVM.

Source

pub fn into_error(self) -> E

Convert the error into an EVMError.

Source

pub fn take_err(self) -> (E, EvmNeedsTx<Db, Insp>)

Reset the EVM, returning the error and the EVM ready for the next transaction.

Source

pub fn err_into<NewErr: From<E>>(self) -> EvmErrored<Db, Insp, NewErr>

Transform the error into a new error type.

Source

pub fn map_err<F, NewErr>(self, f: F) -> EvmErrored<Db, Insp, NewErr>
where F: FnOnce(E) -> NewErr,

Map the error to a new error type.

Source§

impl<Db, Insp> EvmErrored<Db, Insp>
where Db: Database, Insp: Inspector<Ctx<Db>>,

Source

pub const fn is_transaction_error(&self) -> bool

Check if the error is a transaction error. This is provided as a convenience function for common cases, as Transaction errors should usually be discarded.

Source

pub const fn as_transaction_error(&self) -> Option<&InvalidTransaction>

Fallible cast to a InvalidTransaction.

Source

pub fn discard_transaction_error(self) -> Result<EvmNeedsTx<Db, Insp>, Self>

Discard the error if it is a transaction error, returning the EVM. If the error is not a transaction error, return self