pub struct MyEvm<CTX, INSP> {
pub ctx: CTX,
pub inspector: INSP,
pub instruction: EthInstructions<EthInterpreter, CTX>,
pub precompiles: EthPrecompiles,
pub frame_stack: FrameStack<MyFrame>,
}Expand description
Fields§
§ctx: CTXContextTr of the EVM, it is used to fetch data from database.
inspector: INSPInspector of the EVM it is used to inspect the EVM. Its trait are defined in revm-inspector crate.
instruction: EthInstructions<EthInterpreter, CTX>Instructions provider of the EVM it is used to execute instructions.
InstructionProvider trait is defined in revm-handler crate.
precompiles: EthPrecompilesPrecompile provider of the EVM it is used to execute precompiles.
PrecompileProvider trait is defined in revm-handler crate.
frame_stack: FrameStack<MyFrame>The custom frame stack that is going to be executed.
Implementations§
Trait Implementations§
Source§impl<CTX: ContextTr, INSP> EvmTr for MyEvm<CTX, INSP>
impl<CTX: ContextTr, INSP> EvmTr for MyEvm<CTX, INSP>
Source§fn frame_init(
&mut self,
frame_input: <Self::Frame as FrameTr>::FrameInit,
) -> Result<FrameInitResult<'_, Self::Frame>, ContextDbError<CTX>>
fn frame_init( &mut self, frame_input: <Self::Frame as FrameTr>::FrameInit, ) -> Result<FrameInitResult<'_, Self::Frame>, ContextDbError<CTX>>
Initializes the frame for the given frame input. Frame is pushed to the frame stack.
Source§fn frame_run(
&mut self,
) -> Result<FrameInitOrResult<Self::Frame>, ContextDbError<CTX>>
fn frame_run( &mut self, ) -> Result<FrameInitOrResult<Self::Frame>, ContextDbError<CTX>>
Run the frame from the top of the stack. Returns the frame init or result.
If frame has returned result it would mark it as finished.
Source§fn frame_return_result(
&mut self,
result: <Self::Frame as FrameTr>::FrameResult,
) -> Result<Option<<Self::Frame as FrameTr>::FrameResult>, ContextDbError<Self::Context>>
fn frame_return_result( &mut self, result: <Self::Frame as FrameTr>::FrameResult, ) -> Result<Option<<Self::Frame as FrameTr>::FrameResult>, ContextDbError<Self::Context>>
Returns the result of the frame to the caller. Frame is popped from the frame stack. Consumes the frame result or returns it if there is more frames to run.
Source§type Context = CTX
type Context = CTX
Source§type Instructions = EthInstructions<EthInterpreter, CTX>
type Instructions = EthInstructions<EthInterpreter, CTX>
Source§type Precompiles = EthPrecompiles
type Precompiles = EthPrecompiles
Source§fn all(
&self,
) -> (&Self::Context, &Self::Instructions, &Self::Precompiles, &FrameStack<Self::Frame>)
fn all( &self, ) -> (&Self::Context, &Self::Instructions, &Self::Precompiles, &FrameStack<Self::Frame>)
Source§fn all_mut(
&mut self,
) -> (&mut Self::Context, &mut Self::Instructions, &mut Self::Precompiles, &mut FrameStack<Self::Frame>)
fn all_mut( &mut self, ) -> (&mut Self::Context, &mut Self::Instructions, &mut Self::Precompiles, &mut FrameStack<Self::Frame>)
Source§fn ctx_mut(&mut self) -> &mut Self::Context
fn ctx_mut(&mut self) -> &mut Self::Context
Source§fn ctx_instructions(&mut self) -> (&mut Self::Context, &mut Self::Instructions)
fn ctx_instructions(&mut self) -> (&mut Self::Context, &mut Self::Instructions)
Source§fn ctx_precompiles(&mut self) -> (&mut Self::Context, &mut Self::Precompiles)
fn ctx_precompiles(&mut self) -> (&mut Self::Context, &mut Self::Precompiles)
Source§fn frame_stack(&mut self) -> &mut FrameStack<Self::Frame>
fn frame_stack(&mut self) -> &mut FrameStack<Self::Frame>
Source§impl<CTX, INSP> ExecuteCommitEvm for MyEvm<CTX, INSP>
impl<CTX, INSP> ExecuteCommitEvm for MyEvm<CTX, INSP>
Source§fn commit_inner(&mut self)
fn commit_inner(&mut self)
Source§fn transact_commit(
&mut self,
tx: Self::Tx,
) -> Result<Self::ExecutionResult, Self::Error>
fn transact_commit( &mut self, tx: Self::Tx, ) -> Result<Self::ExecutionResult, Self::Error>
Source§fn transact_many_commit(
&mut self,
txs: impl Iterator<Item = Self::Tx>,
) -> Result<Vec<Self::ExecutionResult>, TransactionIndexedError<Self::Error>>
fn transact_many_commit( &mut self, txs: impl Iterator<Item = Self::Tx>, ) -> Result<Vec<Self::ExecutionResult>, TransactionIndexedError<Self::Error>>
Source§fn replay_commit(&mut self) -> Result<Self::ExecutionResult, Self::Error>
fn replay_commit(&mut self) -> Result<Self::ExecutionResult, Self::Error>
Source§impl<CTX, INSP> ExecuteEvm for MyEvm<CTX, INSP>
impl<CTX, INSP> ExecuteEvm for MyEvm<CTX, INSP>
Source§type State = HashMap<Address, Account, FbBuildHasher<20>>
type State = HashMap<Address, Account, FbBuildHasher<20>>
Source§type ExecutionResult = ExecutionResult
type ExecutionResult = ExecutionResult
Source§fn transact_one(
&mut self,
tx: Self::Tx,
) -> Result<Self::ExecutionResult, Self::Error>
fn transact_one( &mut self, tx: Self::Tx, ) -> Result<Self::ExecutionResult, Self::Error>
Source§fn finalize(&mut self) -> Self::State
fn finalize(&mut self) -> Self::State
Source§fn replay(
&mut self,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
fn replay( &mut self, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
Source§fn transact(
&mut self,
tx: Self::Tx,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
fn transact( &mut self, tx: Self::Tx, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
Source§fn transact_many(
&mut self,
txs: impl Iterator<Item = Self::Tx>,
) -> Result<Vec<Self::ExecutionResult>, TransactionIndexedError<Self::Error>>
fn transact_many( &mut self, txs: impl Iterator<Item = Self::Tx>, ) -> Result<Vec<Self::ExecutionResult>, TransactionIndexedError<Self::Error>>
Source§fn transact_many_finalize(
&mut self,
txs: impl Iterator<Item = Self::Tx>,
) -> Result<ExecResultAndState<Vec<Self::ExecutionResult>, Self::State>, TransactionIndexedError<Self::Error>>
fn transact_many_finalize( &mut self, txs: impl Iterator<Item = Self::Tx>, ) -> Result<ExecResultAndState<Vec<Self::ExecutionResult>, Self::State>, TransactionIndexedError<Self::Error>>
Source§impl<CTX, INSP> InspectCommitEvm for MyEvm<CTX, INSP>where
CTX: ContextSetters<Db: DatabaseCommit, Journal: JournalTr<State = EvmState> + JournalExt>,
INSP: Inspector<CTX, EthInterpreter>,
impl<CTX, INSP> InspectCommitEvm for MyEvm<CTX, INSP>where
CTX: ContextSetters<Db: DatabaseCommit, Journal: JournalTr<State = EvmState> + JournalExt>,
INSP: Inspector<CTX, EthInterpreter>,
Source§fn inspect_tx_commit(
&mut self,
tx: Self::Tx,
) -> Result<Self::ExecutionResult, Self::Error>
fn inspect_tx_commit( &mut self, tx: Self::Tx, ) -> Result<Self::ExecutionResult, Self::Error>
InspectEvm::inspect_tx
and commit the state diff to the database. Read moreSource§fn inspect_commit(
&mut self,
tx: Self::Tx,
inspector: Self::Inspector,
) -> Result<Self::ExecutionResult, Self::Error>
fn inspect_commit( &mut self, tx: Self::Tx, inspector: Self::Inspector, ) -> Result<Self::ExecutionResult, Self::Error>
InspectEvm::inspect
and commit the state diff to the database. Read moreSource§impl<CTX, INSP> InspectEvm for MyEvm<CTX, INSP>where
CTX: ContextSetters<Journal: JournalTr<State = EvmState> + JournalExt>,
INSP: Inspector<CTX, EthInterpreter>,
impl<CTX, INSP> InspectEvm for MyEvm<CTX, INSP>where
CTX: ContextSetters<Journal: JournalTr<State = EvmState> + JournalExt>,
INSP: Inspector<CTX, EthInterpreter>,
Source§fn set_inspector(&mut self, inspector: Self::Inspector)
fn set_inspector(&mut self, inspector: Self::Inspector)
Source§fn inspect_one_tx(
&mut self,
tx: Self::Tx,
) -> Result<Self::ExecutionResult, Self::Error>
fn inspect_one_tx( &mut self, tx: Self::Tx, ) -> Result<Self::ExecutionResult, Self::Error>
Source§fn inspect_tx(
&mut self,
tx: Self::Tx,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
fn inspect_tx( &mut self, tx: Self::Tx, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
Source§fn inspect(
&mut self,
tx: Self::Tx,
inspector: Self::Inspector,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
fn inspect( &mut self, tx: Self::Tx, inspector: Self::Inspector, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
Source§fn inspect_one(
&mut self,
tx: Self::Tx,
inspector: Self::Inspector,
) -> Result<Self::ExecutionResult, Self::Error>
fn inspect_one( &mut self, tx: Self::Tx, inspector: Self::Inspector, ) -> Result<Self::ExecutionResult, Self::Error>
Source§impl<CTX, INSP> InspectorEvmTr for MyEvm<CTX, INSP>
impl<CTX, INSP> InspectorEvmTr for MyEvm<CTX, INSP>
Source§fn all_inspector(
&self,
) -> (&Self::Context, &Self::Instructions, &Self::Precompiles, &FrameStack<Self::Frame>, &Self::Inspector)
fn all_inspector( &self, ) -> (&Self::Context, &Self::Instructions, &Self::Precompiles, &FrameStack<Self::Frame>, &Self::Inspector)
Source§fn all_mut_inspector(
&mut self,
) -> (&mut Self::Context, &mut Self::Instructions, &mut Self::Precompiles, &mut FrameStack<Self::Frame>, &mut Self::Inspector)
fn all_mut_inspector( &mut self, ) -> (&mut Self::Context, &mut Self::Instructions, &mut Self::Precompiles, &mut FrameStack<Self::Frame>, &mut Self::Inspector)
Source§fn ctx_inspector(&mut self) -> (&mut Self::Context, &mut Self::Inspector)
fn ctx_inspector(&mut self) -> (&mut Self::Context, &mut Self::Inspector)
Source§fn ctx_inspector_frame(
&mut self,
) -> (&mut Self::Context, &mut Self::Inspector, &mut Self::Frame)
fn ctx_inspector_frame( &mut self, ) -> (&mut Self::Context, &mut Self::Inspector, &mut Self::Frame)
Source§fn ctx_inspector_frame_instructions(
&mut self,
) -> (&mut Self::Context, &mut Self::Inspector, &mut Self::Frame, &mut Self::Instructions)
fn ctx_inspector_frame_instructions( &mut self, ) -> (&mut Self::Context, &mut Self::Inspector, &mut Self::Frame, &mut Self::Instructions)
Source§fn inspect_frame_init(
&mut self,
frame_init: <Self::Frame as FrameTr>::FrameInit,
) -> Result<ItemOrResult<&mut Self::Frame, <Self::Frame as FrameTr>::FrameResult>, ContextError<<<Self::Context as ContextTr>::Db as Database>::Error>>
fn inspect_frame_init( &mut self, frame_init: <Self::Frame as FrameTr>::FrameInit, ) -> Result<ItemOrResult<&mut Self::Frame, <Self::Frame as FrameTr>::FrameResult>, ContextError<<<Self::Context as ContextTr>::Db as Database>::Error>>
Source§fn inspect_frame_run(
&mut self,
) -> Result<ItemOrResult<<Self::Frame as FrameTr>::FrameInit, <Self::Frame as FrameTr>::FrameResult>, ContextError<<<Self::Context as ContextTr>::Db as Database>::Error>>
fn inspect_frame_run( &mut self, ) -> Result<ItemOrResult<<Self::Frame as FrameTr>::FrameInit, <Self::Frame as FrameTr>::FrameResult>, ContextError<<<Self::Context as ContextTr>::Db as Database>::Error>>
Auto Trait Implementations§
impl<CTX, INSP> !RefUnwindSafe for MyEvm<CTX, INSP>
impl<CTX, INSP> !Send for MyEvm<CTX, INSP>
impl<CTX, INSP> !Sync for MyEvm<CTX, INSP>
impl<CTX, INSP> !UnwindSafe for MyEvm<CTX, INSP>
impl<CTX, INSP> Freeze for MyEvm<CTX, INSP>
impl<CTX, INSP> Unpin for MyEvm<CTX, INSP>
impl<CTX, INSP> UnsafeUnpin for MyEvm<CTX, INSP>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.