[−][src]Struct evm::executor::StackExecutor
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]
backend: &'backend B,
gas_limit: usize,
config: &'config Config
) -> Self
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]
backend: &'backend B,
gas_limit: usize,
config: &'config Config,
precompile: fn(_: H160, _: &[u8], _: Option<usize>) -> Option<Result<(ExitSucceed, Vec<u8>, usize), ExitError>>
) -> Self
Create a new stack-based executor with given precompiles.
pub fn substate(
&self,
gas_limit: usize,
is_static: bool
) -> StackExecutor<'backend, 'config, B>
[src]
&self,
gas_limit: usize,
is_static: bool
) -> StackExecutor<'backend, 'config, B>
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]
&mut self,
substate: StackExecutor<'obackend, 'oconfig, OB>
) -> Result<(), ExitError>
Merge a substate executor that succeeded.
pub fn merge_revert<'obackend, 'oconfig, OB>(
&mut self,
substate: StackExecutor<'obackend, 'oconfig, OB>
) -> Result<(), ExitError>
[src]
&mut self,
substate: StackExecutor<'obackend, 'oconfig, OB>
) -> Result<(), ExitError>
Merge a substate executor that reverted.
pub fn merge_fail<'obackend, 'oconfig, OB>(
&mut self,
substate: StackExecutor<'obackend, 'oconfig, OB>
) -> Result<(), ExitError>
[src]
&mut self,
substate: StackExecutor<'obackend, 'oconfig, OB>
) -> Result<(), ExitError>
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]
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8>,
gas_limit: usize
) -> ExitReason
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]
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8>,
salt: H256,
gas_limit: usize
) -> ExitReason
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]
&mut self,
caller: H160,
address: H160,
value: U256,
data: Vec<u8>,
gas_limit: usize
) -> (ExitReason, Vec<u8>)
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]
self
) -> (impl IntoIterator<Item = Apply<impl IntoIterator<Item = (H256, H256)>>>, impl IntoIterator<Item = Log>)
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]
&mut self,
address: H160,
balance: U256
) -> Result<(), ExitError>
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]
fn clone(&self) -> StackExecutor<'backend, 'config, B>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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.
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<usize>
) -> Capture<(ExitReason, Option<H160>, Vec<u8>), Self::CreateInterrupt>
[src]
&mut self,
caller: H160,
scheme: CreateScheme,
value: U256,
init_code: Vec<u8>,
target_gas: Option<usize>
) -> Capture<(ExitReason, Option<H160>, Vec<u8>), Self::CreateInterrupt>
fn call(
&mut self,
code_address: H160,
transfer: Option<Transfer>,
input: Vec<u8>,
target_gas: Option<usize>,
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<usize>,
is_static: bool,
context: Context
) -> Capture<(ExitReason, Vec<u8>), Self::CallInterrupt>
fn pre_validate(
&mut self,
context: &Context,
opcode: Result<Opcode, ExternalOpcode>,
stack: &Stack
) -> Result<(), ExitError>
[src]
&mut self,
context: &Context,
opcode: Result<Opcode, ExternalOpcode>,
stack: &Stack
) -> Result<(), ExitError>
fn create_feedback(
&mut self,
_feedback: Self::CreateFeedback
) -> Result<(), ExitError>
[src]
&mut self,
_feedback: Self::CreateFeedback
) -> Result<(), ExitError>
fn call_feedback(
&mut self,
_feedback: Self::CallFeedback
) -> Result<(), ExitError>
[src]
&mut self,
_feedback: Self::CallFeedback
) -> Result<(), ExitError>
fn other(&mut self, _opcode: u8, _stack: &mut Machine) -> Result<(), ExitError>
[src]
Auto Trait Implementations
impl<'backend, 'config, B> RefUnwindSafe for StackExecutor<'backend, 'config, B> where
B: RefUnwindSafe,
B: RefUnwindSafe,
impl<'backend, 'config, B> Send for StackExecutor<'backend, 'config, B> where
B: Sync,
B: Sync,
impl<'backend, 'config, B> Sync for StackExecutor<'backend, 'config, B> where
B: Sync,
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,
B: RefUnwindSafe,
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,
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
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,