Struct evm_state::StackExecutor [−][src]
Stack-based executor.
Implementations
impl<'config, 'precompile, S> StackExecutor<'config, 'precompile, S> where
S: StackState<'config>,
[src]
S: StackState<'config>,
pub fn new(
state: S,
config: &'config Config
) -> StackExecutor<'config, 'precompile, S>
[src]
state: S,
config: &'config Config
) -> StackExecutor<'config, 'precompile, S>
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]
state: S,
config: &'config Config,
precompile: &'precompile mut (dyn FnMut(H160, &[u8], Option<u64>, &Context) + 'precompile)
) -> StackExecutor<'config, 'precompile, S>
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]
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8, Global>,
gas_limit: u64
) -> ExitReason
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]
&mut self,
caller: H160,
value: U256,
init_code: Vec<u8, Global>,
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, Global>,
gas_limit: u64
) -> (ExitReason, Vec<u8, Global>)
[src]
&mut self,
caller: H160,
address: H160,
value: U256,
data: Vec<u8, Global>,
gas_limit: u64
) -> (ExitReason, Vec<u8, Global>)
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]
S: StackState<'config>,
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.
pub fn balance(&self, address: H160) -> U256
[src]
pub fn code_size(&self, address: H160) -> U256
[src]
pub fn code_hash(&self, address: H160) -> H256
[src]
pub fn code(&self, address: H160) -> Vec<u8, Global>
[src]
pub fn storage(&self, address: H160, index: H256) -> H256
[src]
pub fn original_storage(&self, address: H160, index: H256) -> H256
[src]
pub fn exists(&self, address: H160) -> bool
[src]
pub fn gas_left(&self) -> U256
[src]
pub fn gas_price(&self) -> U256
[src]
pub fn origin(&self) -> H160
[src]
pub fn block_hash(&self, number: U256) -> H256
[src]
pub fn block_number(&self) -> U256
[src]
pub fn block_coinbase(&self) -> H160
[src]
pub fn block_timestamp(&self) -> U256
[src]
pub fn block_difficulty(&self) -> U256
[src]
pub fn block_gas_limit(&self) -> U256
[src]
pub fn chain_id(&self) -> U256
[src]
pub fn deleted(&self, address: H160) -> bool
[src]
pub fn set_storage(
&mut self,
address: H160,
index: H256,
value: H256
) -> Result<(), ExitError>
[src]
&mut self,
address: H160,
index: H256,
value: H256
) -> Result<(), ExitError>
pub fn log(
&mut self,
address: H160,
topics: Vec<H256, Global>,
data: Vec<u8, Global>
) -> Result<(), ExitError>
[src]
&mut self,
address: H160,
topics: Vec<H256, Global>,
data: Vec<u8, Global>
) -> Result<(), ExitError>
pub fn mark_delete(
&mut self,
address: H160,
target: H160
) -> Result<(), ExitError>
[src]
&mut self,
address: H160,
target: H160
) -> Result<(), ExitError>
pub fn create(
&mut self,
caller: H160,
scheme: CreateScheme,
value: U256,
init_code: Vec<u8, Global>,
target_gas: Option<u64>
) -> Capture<(ExitReason, Option<H160>, Vec<u8, Global>), <StackExecutor<'config, 'precompile, S> as Handler>::CreateInterrupt>
[src]
&mut self,
caller: H160,
scheme: CreateScheme,
value: U256,
init_code: Vec<u8, Global>,
target_gas: Option<u64>
) -> Capture<(ExitReason, Option<H160>, Vec<u8, Global>), <StackExecutor<'config, 'precompile, S> as Handler>::CreateInterrupt>
pub fn call(
&mut self,
code_address: H160,
transfer: Option<Transfer>,
input: Vec<u8, Global>,
target_gas: Option<u64>,
is_static: bool,
context: Context
) -> Capture<(ExitReason, Vec<u8, Global>), <StackExecutor<'config, 'precompile, S> as Handler>::CallInterrupt>
[src]
&mut self,
code_address: H160,
transfer: Option<Transfer>,
input: Vec<u8, Global>,
target_gas: Option<u64>,
is_static: bool,
context: Context
) -> Capture<(ExitReason, Vec<u8, Global>), <StackExecutor<'config, 'precompile, S> as Handler>::CallInterrupt>
pub 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>,