Struct evm_state::StackExecutor[][src]

pub struct StackExecutor<'config, 'precompile, S> { /* fields omitted */ }

Stack-based executor.

Implementations

impl<'config, 'precompile, S> StackExecutor<'config, 'precompile, S> where
    S: StackState<'config>, 
[src]

pub fn new(
    state: S,
    config: &'config Config
) -> StackExecutor<'config, 'precompile, S>
[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) + 'precompile)
) -> StackExecutor<'config, 'precompile, S>
[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]

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, Global>,
    gas_limit: u64
) -> ExitReason
[src]

Execute a CREATE transaction.

pub fn transact_create2(
    &mut self,
    caller: H160,
    value: U256,
    init_code: Vec<u8, Global>,
    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, Global>,
    gas_limit: u64
) -> (ExitReason, Vec<u8, Global>)
[src]

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> Handler for StackExecutor<'config, 'precompile, S> where
    S: StackState<'config>, 
[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.

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

impl<'config, 'precompile, S> !UnwindSafe for StackExecutor<'config, 'precompile, S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]