[][src]Struct evm::executor::StackExecutor

pub struct StackExecutor<'backend, 'config, B> { /* fields omitted */ }

Stack-based executor.

Implementations

impl<'backend, 'config, B: Backend> StackExecutor<'backend, 'config, B>[src]

pub fn new(
    backend: &'backend B,
    gas_limit: usize,
    config: &'config Config
) -> Self
[src]

Create a new stack-based executor.

pub fn new_with_precompile(
    backend: &'backend B,
    gas_limit: usize,
    config: &'config Config,
    precompile: fn(_: H160, _: &[u8], _: Option<usize>) -> Option<Result<(ExitSucceed, Vec<u8>, usize), ExitError>>
) -> Self
[src]

Create a new stack-based executor with given precompiles.

pub fn substate(
    &self,
    gas_limit: usize,
    is_static: bool
) -> StackExecutor<'backend, 'config, B>
[src]

Create a substate executor from the current executor.

pub fn execute(&mut self, runtime: &mut Runtime<'_>) -> ExitReason[src]

Execute the runtime until it returns.

pub fn gas(&self) -> usize[src]

Get remaining gas.

pub fn merge_succeed<'obackend, 'oconfig, OB>(
    &mut self,
    substate: StackExecutor<'obackend, 'oconfig, OB>
) -> Result<(), ExitError>
[src]

Merge a substate executor that succeeded.

pub fn merge_revert<'obackend, 'oconfig, OB>(
    &mut self,
    substate: StackExecutor<'obackend, 'oconfig, OB>
) -> Result<(), ExitError>
[src]

Merge a substate executor that reverted.

pub fn merge_fail<'obackend, 'oconfig, OB>(
    &mut self,
    substate: StackExecutor<'obackend, 'oconfig, OB>
) -> Result<(), ExitError>
[src]

Merge a substate executor that failed.

pub fn transact_create(
    &mut self,
    caller: H160,
    value: U256,
    init_code: Vec<u8>,
    gas_limit: usize
) -> ExitReason
[src]

Execute a CREATE transaction.

pub fn transact_create2(
    &mut self,
    caller: H160,
    value: U256,
    init_code: Vec<u8>,
    salt: H256,
    gas_limit: usize
) -> ExitReason
[src]

Execute a CREATE2 transaction.

pub fn transact_call(
    &mut self,
    caller: H160,
    address: H160,
    value: U256,
    data: Vec<u8>,
    gas_limit: usize
) -> (ExitReason, Vec<u8>)
[src]

Execute a CALL transaction.

pub fn used_gas(&self) -> usize[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.

#[must_use]pub fn deconstruct(
    self
) -> (impl IntoIterator<Item = Apply<impl IntoIterator<Item = (H256, H256)>>>, impl IntoIterator<Item = Log>)
[src]

Deconstruct the executor, return state to be applied.

pub fn account_mut(&mut self, address: H160) -> &mut StackAccount[src]

Get mutable account reference.

pub fn nonce(&self, address: H160) -> U256[src]

Get account nonce.

pub fn withdraw(
    &mut self,
    address: H160,
    balance: U256
) -> Result<(), ExitError>
[src]

Withdraw balance from address.

pub fn deposit(&mut self, address: H160, balance: U256)[src]

Deposit balance to address.

pub fn transfer(&mut self, transfer: Transfer) -> Result<(), ExitError>[src]

Transfer balance with the given struct.

pub fn create_address(&self, scheme: CreateScheme) -> H160[src]

Get the create address from given scheme.

Trait Implementations

impl<'backend, 'config, B: Clone> Clone for StackExecutor<'backend, 'config, B>[src]

impl<'backend, 'config, B: Backend> Handler for StackExecutor<'backend, 'config, B>[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<'backend, 'config, B> RefUnwindSafe for StackExecutor<'backend, 'config, B> where
    B: RefUnwindSafe

impl<'backend, 'config, B> Send for StackExecutor<'backend, 'config, B> where
    B: Sync

impl<'backend, 'config, B> Sync for StackExecutor<'backend, 'config, B> where
    B: Sync

impl<'backend, 'config, B> Unpin for StackExecutor<'backend, 'config, B>

impl<'backend, 'config, B> UnwindSafe for StackExecutor<'backend, 'config, B> where
    B: RefUnwindSafe

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

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,