-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move some files. cleanup comments
- Loading branch information
Showing
19 changed files
with
135 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
mod call_inputs; | ||
mod call_outcome; | ||
mod create_inputs; | ||
mod create_outcome; | ||
mod eof_create_inputs; | ||
mod eof_create_outcome; | ||
|
||
pub use call_inputs::{CallInputs, CallScheme, TransferValue}; | ||
pub use call_outcome::CallOutcome; | ||
pub use create_inputs::{CreateInputs, CreateScheme}; | ||
pub use create_outcome::CreateOutcome; | ||
pub use eof_create_inputs::EOFCreateInput; | ||
pub use eof_create_outcome::EOFCreateOutcome; | ||
|
||
use crate::InterpreterResult; | ||
use std::boxed::Box; | ||
|
||
#[derive(Clone, Debug, Default, PartialEq, Eq)] | ||
pub enum InterpreterAction { | ||
/// CALL, CALLCODE, DELEGATECALL, STATICCALL | ||
/// or EOF EXT instuction called. | ||
Call { inputs: Box<CallInputs> }, | ||
/// CREATE or CREATE2 instruction called. | ||
Create { inputs: Box<CreateInputs> }, | ||
/// EOF CREATE instruction called. | ||
EOFCreate { inputs: Box<EOFCreateInput> }, | ||
/// Interpreter finished execution. | ||
Return { result: InterpreterResult }, | ||
/// No action | ||
#[default] | ||
None, | ||
} | ||
|
||
impl InterpreterAction { | ||
/// Returns true if action is call. | ||
pub fn is_call(&self) -> bool { | ||
matches!(self, InterpreterAction::Call { .. }) | ||
} | ||
|
||
/// Returns true if action is create. | ||
pub fn is_create(&self) -> bool { | ||
matches!(self, InterpreterAction::Create { .. }) | ||
} | ||
|
||
/// Returns true if action is return. | ||
pub fn is_return(&self) -> bool { | ||
matches!(self, InterpreterAction::Return { .. }) | ||
} | ||
|
||
/// Returns true if action is none. | ||
pub fn is_none(&self) -> bool { | ||
matches!(self, InterpreterAction::None) | ||
} | ||
|
||
/// Returns true if action is some. | ||
pub fn is_some(&self) -> bool { | ||
!self.is_none() | ||
} | ||
|
||
/// Returns result if action is return. | ||
pub fn into_result_return(self) -> Option<InterpreterResult> { | ||
match self { | ||
InterpreterAction::Return { result } => Some(result), | ||
_ => None, | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.