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][+]
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,
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>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,