Struct evm::executor::StackExecutor [−][src]
pub struct StackExecutor<'config, S> { /* fields omitted */ }
Expand description
Stack-based executor.
Implementations
impl<'config, S: StackState<'config>> StackExecutor<'config, S>
[src]
impl<'config, S: StackState<'config>> StackExecutor<'config, S>
[src]pub fn new_with_precompile(
state: S,
config: &'config Config,
precompile: fn(_: H160, _: &[u8], _: Option<u64>, _: &Context) -> Option<Result<PrecompileOutput, ExitError>>
) -> Self
[src]
pub fn new_with_precompile(
state: S,
config: &'config Config,
precompile: fn(_: H160, _: &[u8], _: Option<u64>, _: &Context) -> Option<Result<PrecompileOutput, ExitError>>
) -> Self
[src]Create a new stack-based executor with given precompiles.
pub fn state(&self) -> &S
[src]
pub fn state_mut(&mut self) -> &mut S
[src]
pub fn into_state(self) -> S
[src]
pub fn enter_substate(&mut self, gas_limit: u64, is_static: bool)
[src]
pub fn enter_substate(&mut self, gas_limit: u64, is_static: bool)
[src]Create a substate executor from the current executor.
pub fn exit_substate(&mut self, kind: StackExitKind) -> Result<(), ExitError>
[src]
pub fn exit_substate(&mut self, kind: StackExitKind) -> Result<(), ExitError>
[src]Exit a substate. Panic if it results an empty substate stack.
pub fn execute(&mut self, runtime: &mut Runtime<'_>) -> ExitReason
[src]
pub fn execute(&mut self, runtime: &mut Runtime<'_>) -> ExitReason
[src]Execute the runtime until it returns.
pub fn transact_create(
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8>,
gas_limit: u64
) -> ExitReason
[src]
pub fn transact_create(
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8>,
gas_limit: u64
) -> ExitReason
[src]Execute a CREATE
transaction.
pub fn transact_create2(
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8>,
salt: H256,
gas_limit: u64
) -> ExitReason
[src]
pub fn transact_create2(
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8>,
salt: H256,
gas_limit: u64
) -> ExitReason
[src]Execute a CREATE2
transaction.
pub fn transact_call(
&mut self,
caller: H160,
address: H160,
value: U256,
data: Vec<u8>,
gas_limit: u64
) -> (ExitReason, Vec<u8>)
[src]
pub fn transact_call(
&mut self,
caller: H160,
address: H160,
value: U256,
data: Vec<u8>,
gas_limit: u64
) -> (ExitReason, Vec<u8>)
[src]Execute a CALL
transaction.
pub fn fee(&self, price: U256) -> U256
[src]
pub fn fee(&self, price: U256) -> U256
[src]Get fee needed for the current executor, given the price.
pub fn create_address(&self, scheme: CreateScheme) -> H160
[src]
pub fn create_address(&self, scheme: CreateScheme) -> H160
[src]Get the create address from given scheme.
Trait Implementations
impl<'config, S: StackState<'config>> Handler for StackExecutor<'config, S>
[src]
impl<'config, S: StackState<'config>> Handler for StackExecutor<'config, S>
[src]type CreateInterrupt = Infallible
type CreateInterrupt = Infallible
Type of CREATE
interrupt.
type CreateFeedback = Infallible
type CreateFeedback = Infallible
Feedback value for CREATE
interrupt.
type CallInterrupt = Infallible
type CallInterrupt = Infallible
Type of CALL
interrupt.
type CallFeedback = Infallible
type CallFeedback = Infallible
Feedback value of CALL
interrupt.
fn original_storage(&self, address: H160, index: H256) -> H256
[src]
fn original_storage(&self, address: H160, index: H256) -> H256
[src]Get original storage value of address at index.
fn block_hash(&self, number: U256) -> H256
[src]
fn block_hash(&self, number: U256) -> H256
[src]Get environmental block hash.
fn block_number(&self) -> U256
[src]
fn block_number(&self) -> U256
[src]Get environmental block number.
fn block_coinbase(&self) -> H160
[src]
fn block_coinbase(&self) -> H160
[src]Get environmental coinbase.
fn block_timestamp(&self) -> U256
[src]
fn block_timestamp(&self) -> U256
[src]Get environmental block timestamp.
fn block_difficulty(&self) -> U256
[src]
fn block_difficulty(&self) -> U256
[src]Get environmental block difficulty.
fn block_gas_limit(&self) -> U256
[src]
fn block_gas_limit(&self) -> U256
[src]Get environmental gas limit.
fn set_storage(
&mut self,
address: H160,
index: H256,
value: H256
) -> Result<(), ExitError>
[src]
fn set_storage(
&mut self,
address: H160,
index: H256,
value: H256
) -> Result<(), ExitError>
[src]Set storage value of address at index.
fn log(
&mut self,
address: H160,
topics: Vec<H256>,
data: Vec<u8>
) -> Result<(), ExitError>
[src]
fn log(
&mut self,
address: H160,
topics: Vec<H256>,
data: Vec<u8>
) -> Result<(), ExitError>
[src]Create a log owned by address with given topics and data.
fn mark_delete(&mut self, address: H160, target: H160) -> Result<(), ExitError>
[src]
fn mark_delete(&mut self, address: H160, target: H160) -> Result<(), ExitError>
[src]Mark an address to be deleted, with funds transferred to target.
fn create(
&mut self,
caller: H160,
scheme: CreateScheme,
value: U256,
init_code: Vec<u8>,
target_gas: Option<u64>
) -> Capture<(ExitReason, Option<H160>, Vec<u8>), Self::CreateInterrupt>
[src]
fn create(
&mut self,
caller: H160,
scheme: CreateScheme,
value: U256,
init_code: Vec<u8>,
target_gas: Option<u64>
) -> Capture<(ExitReason, Option<H160>, Vec<u8>), Self::CreateInterrupt>
[src]Invoke a create operation.
fn call(
&mut self,
code_address: H160,
transfer: Option<Transfer>,
input: Vec<u8>,
target_gas: Option<u64>,
is_static: bool,
context: Context
) -> Capture<(ExitReason, Vec<u8>), Self::CallInterrupt>
[src]
fn call(
&mut self,
code_address: H160,
transfer: Option<Transfer>,
input: Vec<u8>,
target_gas: Option<u64>,
is_static: bool,
context: Context
) -> Capture<(ExitReason, Vec<u8>), Self::CallInterrupt>
[src]Invoke a call operation.
fn pre_validate(
&mut self,
context: &Context,
opcode: Opcode,
stack: &Stack
) -> Result<(), ExitError>
[src]
fn pre_validate(
&mut self,
context: &Context,
opcode: Opcode,
stack: &Stack
) -> Result<(), ExitError>
[src]Pre-validation step for the runtime.
fn create_feedback(
&mut self,
_feedback: Self::CreateFeedback
) -> Result<(), ExitError>
[src]
fn create_feedback(
&mut self,
_feedback: Self::CreateFeedback
) -> Result<(), ExitError>
[src]Feed in create feedback.
fn call_feedback(
&mut self,
_feedback: Self::CallFeedback
) -> Result<(), ExitError>
[src]
fn call_feedback(
&mut self,
_feedback: Self::CallFeedback
) -> Result<(), ExitError>
[src]Feed in call feedback.
Auto Trait Implementations
impl<'config, S> RefUnwindSafe for StackExecutor<'config, S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<'config, S> Send for StackExecutor<'config, S> where
S: Send,
S: Send,
impl<'config, S> Sync for StackExecutor<'config, S> where
S: Sync,
S: Sync,
impl<'config, S> Unpin for StackExecutor<'config, S> where
S: Unpin,
S: Unpin,
impl<'config, S> UnwindSafe for StackExecutor<'config, S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self