Struct evm::executor::StackExecutor [−][src]
Stack-based executor.
Implementations
impl<'config, 'precompile, S: StackState<'config>> StackExecutor<'config, 'precompile, S>
[src]
pub fn new(state: S, config: &'config Config) -> Self
[src]
Create a new stack-based executor.
pub fn new_with_precompile(
state: S,
config: &'config Config,
precompile: &'precompile mut dyn FnMut(H160, &[u8], Option<u64>, &Context) -> Option<Result<(ExitSucceed, Vec<u8>, u64), ExitError>>
) -> Self
[src]
state: S,
config: &'config Config,
precompile: &'precompile mut dyn FnMut(H160, &[u8], Option<u64>, &Context) -> Option<Result<(ExitSucceed, Vec<u8>, u64), ExitError>>
) -> Self
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]
Create a substate executor from the current executor.
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]
Execute the runtime until it returns.
pub fn gas(&self) -> u64
[src]
Get remaining gas.
pub fn transact_create(
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8>,
gas_limit: u64
) -> ExitReason
[src]
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8>,
gas_limit: u64
) -> ExitReason
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]
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8>,
salt: H256,
gas_limit: u64
) -> ExitReason
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]
&mut self,
caller: H160,
address: H160,
value: U256,
data: Vec<u8>,
gas_limit: u64
) -> (ExitReason, Vec<u8>)
Execute a CALL
transaction.
pub fn used_gas(&self) -> u64
[src]
Get used gas for the current executor, given the price.
pub fn fee(&self, price: U256) -> U256
[src]
Get fee needed for the current executor, given the price.
pub fn nonce(&self, address: H160) -> U256
[src]
Get account nonce.
pub fn create_address(&self, scheme: CreateScheme) -> H160
[src]
Get the create address from given scheme.
Trait Implementations
impl<'config, 'precompile, S: StackState<'config>> Handler for StackExecutor<'config, 'precompile, S>
[src]
type CreateInterrupt = Infallible
Type of CREATE
interrupt.
type CreateFeedback = Infallible
Feedback value for CREATE
interrupt.
type CallInterrupt = Infallible
Type of CALL
interrupt.
type CallFeedback = Infallible
Feedback value of CALL
interrupt.
fn balance(&self, address: H160) -> U256
[src]
fn code_size(&self, address: H160) -> U256
[src]
fn code_hash(&self, address: H160) -> H256
[src]
fn code(&self, address: H160) -> Vec<u8>
[src]
fn storage(&self, address: H160, index: H256) -> H256
[src]
fn original_storage(&self, address: H160, index: H256) -> H256
[src]
fn exists(&self, address: H160) -> bool
[src]
fn gas_left(&self) -> U256
[src]
fn gas_price(&self) -> U256
[src]
fn origin(&self) -> H160
[src]
fn block_hash(&self, number: U256) -> H256
[src]
fn block_number(&self) -> U256
[src]
fn block_coinbase(&self) -> H160
[src]
fn block_timestamp(&self) -> U256
[src]
fn block_difficulty(&self) -> U256
[src]
fn block_gas_limit(&self) -> U256
[src]
fn chain_id(&self) -> U256
[src]
fn deleted(&self, address: H160) -> bool
[src]
fn set_storage(
&mut self,
address: H160,
index: H256,
value: H256
) -> Result<(), ExitError>
[src]
&mut self,
address: H160,
index: H256,
value: H256
) -> Result<(), ExitError>
fn log(
&mut self,
address: H160,
topics: Vec<H256>,
data: Vec<u8>
) -> Result<(), ExitError>
[src]
&mut self,
address: H160,
topics: Vec<H256>,
data: Vec<u8>
) -> Result<(), ExitError>
fn mark_delete(&mut self, address: H160, target: H160) -> Result<(), ExitError>
[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]
&mut self,
caller: H160,
scheme: CreateScheme,
value: U256,
init_code: Vec<u8>,
target_gas: Option<u64>
) -> Capture<(ExitReason, Option<H160>, Vec<u8>), Self::CreateInterrupt>
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]
&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>
fn pre_validate(
&mut self,
context: &Context,
opcode: Opcode,
stack: &Stack
) -> Result<(), ExitError>
[src]
&mut self,
context: &Context,
opcode: Opcode,
stack: &Stack
) -> Result<(), ExitError>
pub fn create_feedback(
&mut self,
_feedback: Self::CreateFeedback
) -> Result<(), ExitError>
[src]
&mut self,
_feedback: Self::CreateFeedback
) -> Result<(), ExitError>
pub fn call_feedback(
&mut self,
_feedback: Self::CallFeedback
) -> Result<(), ExitError>
[src]
&mut self,
_feedback: Self::CallFeedback
) -> Result<(), ExitError>
pub fn other(
&mut self,
_opcode: Opcode,
_stack: &mut Machine
) -> Result<(), ExitError>
[src]
&mut self,
_opcode: Opcode,
_stack: &mut Machine
) -> Result<(), ExitError>
Auto Trait Implementations
impl<'config, 'precompile, S> !RefUnwindSafe for StackExecutor<'config, 'precompile, S>
impl<'config, 'precompile, S> !Send for StackExecutor<'config, 'precompile, S>
impl<'config, 'precompile, S> !Sync for StackExecutor<'config, 'precompile, S>
impl<'config, 'precompile, S> Unpin for StackExecutor<'config, 'precompile, S> where
S: Unpin,
S: Unpin,
impl<'config, 'precompile, S> !UnwindSafe for StackExecutor<'config, 'precompile, S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,