pub type EvmHandler<'a, EXT, DB> = Handler<'a, Context<EXT, DB>, EXT, DB>;
Expand description
EVM Handler
Aliased Type§
struct EvmHandler<'a, EXT, DB> {
pub cfg: HandlerCfg,
pub instruction_table: InstructionTables<'a, Context<EXT, DB>>,
pub registers: Vec<HandleRegisters<'a, EXT, DB>>,
pub validation: ValidationHandler<'a, EXT, DB>,
pub pre_execution: PreExecutionHandler<'a, EXT, DB>,
pub post_execution: PostExecutionHandler<'a, EXT, DB>,
pub execution: ExecutionHandler<'a, EXT, DB>,
}
Fields§
§cfg: HandlerCfg
Handler configuration.
instruction_table: InstructionTables<'a, Context<EXT, DB>>
Instruction table type.
registers: Vec<HandleRegisters<'a, EXT, DB>>
Registers that will be called on initialization.
validation: ValidationHandler<'a, EXT, DB>
Validity handles.
pre_execution: PreExecutionHandler<'a, EXT, DB>
Pre execution handle.
post_execution: PostExecutionHandler<'a, EXT, DB>
Post Execution handle.
execution: ExecutionHandler<'a, EXT, DB>
Execution loop that handles frames.
Implementations§
Source§impl<'a, EXT, DB: Database> EvmHandler<'a, EXT, DB>
impl<'a, EXT, DB: Database> EvmHandler<'a, EXT, DB>
Sourcepub fn new(cfg: HandlerCfg) -> Self
pub fn new(cfg: HandlerCfg) -> Self
Created new Handler with given configuration.
Internally it calls mainnet_with_spec
with the given spec id.
Or optimism_with_spec
if the optimism feature is enabled and cfg.is_optimism
is set.
Sourcepub fn is_optimism(&self) -> bool
pub fn is_optimism(&self) -> bool
Returns true
if the optimism feature is enabled and flag is set to true
.
Sourcepub fn mainnet_with_spec(spec_id: SpecId) -> Self
pub fn mainnet_with_spec(spec_id: SpecId) -> Self
Creates handler with variable spec id, inside it will call mainnet::<SPEC>
for
appropriate spec.
Sourcepub fn cfg(&self) -> HandlerCfg
pub fn cfg(&self) -> HandlerCfg
Specification ID.
Sourcepub fn execute_frame(
&self,
frame: &mut Frame,
shared_memory: &mut SharedMemory,
context: &mut Context<EXT, DB>,
) -> Result<InterpreterAction, EVMError<DB::Error>>
pub fn execute_frame( &self, frame: &mut Frame, shared_memory: &mut SharedMemory, context: &mut Context<EXT, DB>, ) -> Result<InterpreterAction, EVMError<DB::Error>>
Executes call frame.
Sourcepub fn take_instruction_table(
&mut self,
) -> InstructionTables<'a, Context<EXT, DB>>
pub fn take_instruction_table( &mut self, ) -> InstructionTables<'a, Context<EXT, DB>>
Take instruction table.
Sourcepub fn set_instruction_table(
&mut self,
table: InstructionTables<'a, Context<EXT, DB>>,
)
pub fn set_instruction_table( &mut self, table: InstructionTables<'a, Context<EXT, DB>>, )
Set instruction table.
Sourcepub fn pre_execution(&self) -> &PreExecutionHandler<'a, EXT, DB>
pub fn pre_execution(&self) -> &PreExecutionHandler<'a, EXT, DB>
Returns reference to pre execution handler.
Sourcepub fn post_execution(&self) -> &PostExecutionHandler<'a, EXT, DB>
pub fn post_execution(&self) -> &PostExecutionHandler<'a, EXT, DB>
Returns reference to pre execution handler.
Sourcepub fn execution(&self) -> &ExecutionHandler<'a, EXT, DB>
pub fn execution(&self) -> &ExecutionHandler<'a, EXT, DB>
Returns reference to frame handler.
Sourcepub fn validation(&self) -> &ValidationHandler<'a, EXT, DB>
pub fn validation(&self) -> &ValidationHandler<'a, EXT, DB>
Returns reference to validation handler.
Sourcepub fn append_handler_register(
&mut self,
register: HandleRegisters<'a, EXT, DB>,
)
pub fn append_handler_register( &mut self, register: HandleRegisters<'a, EXT, DB>, )
Append handle register.
Sourcepub fn append_handler_register_plain(
&mut self,
register: HandleRegister<EXT, DB>,
)
pub fn append_handler_register_plain( &mut self, register: HandleRegister<EXT, DB>, )
Append plain handle register.
Sourcepub fn append_handler_register_box(
&mut self,
register: HandleRegisterBox<'a, EXT, DB>,
)
pub fn append_handler_register_box( &mut self, register: HandleRegisterBox<'a, EXT, DB>, )
Append boxed handle register.
Sourcepub fn pop_handle_register(&mut self) -> Option<HandleRegisters<'a, EXT, DB>>
pub fn pop_handle_register(&mut self) -> Option<HandleRegisters<'a, EXT, DB>>
Pop last handle register and reapply all registers that are left.
Sourcepub fn create_handle_generic<SPEC: Spec>(&mut self) -> EvmHandler<'a, EXT, DB>
pub fn create_handle_generic<SPEC: Spec>(&mut self) -> EvmHandler<'a, EXT, DB>
Creates the Handler with Generic Spec.
Sourcepub fn modify_spec_id(&mut self, spec_id: SpecId)
pub fn modify_spec_id(&mut self, spec_id: SpecId)
Creates the Handler with variable SpecId, inside it will call function with Generic Spec.