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, CreateScheme};
pub use create_outcome::CreateOutcome;
pub use eof_create_inputs::{EOFCreateInputs, EOFCreateKind};
use crate::InterpreterResult;
use std::boxed::Box;
#[derive(Clone, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum InterpreterAction {
Call { inputs: Box<CallInputs> },
Create { inputs: Box<CreateInputs> },
EOFCreate { inputs: Box<EOFCreateInputs> },
Return { result: InterpreterResult },
#[default]
None,
}
impl InterpreterAction {
pub fn is_call(&self) -> bool {
matches!(self, InterpreterAction::Call { .. })
}
pub fn is_create(&self) -> bool {
matches!(self, InterpreterAction::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,
}
}
}