revm_interpreter/
interpreter_action.rsmod call_inputs;
mod call_outcome;
mod create_inputs;
mod create_outcome;
mod eof_create_inputs;
pub use call_inputs::{CallInputs, CallScheme, CallValue};
pub use call_outcome::CallOutcome;
pub use create_inputs::CreateInputs;
pub use create_outcome::CreateOutcome;
pub use eof_create_inputs::{EOFCreateInputs, EOFCreateKind};
use crate::InterpreterResult;
use std::boxed::Box;
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum FrameInput {
Call(Box<CallInputs>),
Create(Box<CreateInputs>),
EOFCreate(Box<EOFCreateInputs>),
}
impl AsMut<Self> for FrameInput {
fn as_mut(&mut self) -> &mut Self {
self
}
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum InterpreterAction {
NewFrame(FrameInput),
Return { result: InterpreterResult },
#[default]
None,
}
impl InterpreterAction {
pub fn is_call(&self) -> bool {
matches!(self, InterpreterAction::NewFrame(FrameInput::Call(..)))
}
pub fn is_create(&self) -> bool {
matches!(self, InterpreterAction::NewFrame(FrameInput::Create(..)))
}
pub fn is_return(&self) -> bool {
matches!(self, InterpreterAction::Return { .. })
}
pub fn is_none(&self) -> bool {
matches!(self, InterpreterAction::None)
}
pub fn is_some(&self) -> bool {
!self.is_none()
}
pub fn into_result_return(self) -> Option<InterpreterResult> {
match self {
InterpreterAction::Return { result } => Some(result),
_ => None,
}
}
}