[−][src]Struct ethereumvm::ContextVM
A VM that executes using a context and block information.
Methods
impl<'a, M: Memory, P: Patch> ContextVM<'a, M, P>
[src]
pub fn new(patch: &'a P, context: Context, block: HeaderParams) -> Self
[src]
Create a new VM using the given context, block header and patch.
pub fn with_states(
patch: &'a P,
context: Context,
block: HeaderParams,
account_state: AccountState<'a, P::Account>,
blockhash_state: BlockhashState
) -> Self
[src]
patch: &'a P,
context: Context,
block: HeaderParams,
account_state: AccountState<'a, P::Account>,
blockhash_state: BlockhashState
) -> Self
Create a new VM with the given account state and blockhash state.
pub fn with_init<F: FnOnce(&mut ContextVM<M, P>)>(
patch: &'a P,
context: Context,
block: HeaderParams,
account_state: AccountState<'a, P::Account>,
blockhash_state: BlockhashState,
f: F
) -> Self
[src]
patch: &'a P,
context: Context,
block: HeaderParams,
account_state: AccountState<'a, P::Account>,
blockhash_state: BlockhashState,
f: F
) -> Self
Create a new VM with customized initialization code.
pub fn with_previous(
patch: &'a P,
context: Context,
block: HeaderParams,
vm: &'a ContextVM<'a, M, P>
) -> Self
[src]
patch: &'a P,
context: Context,
block: HeaderParams,
vm: &'a ContextVM<'a, M, P>
) -> Self
Create a new VM with the result of the previous VM. This is usually used by transaction for chainning them.
pub fn current_state(&self) -> &State<M, P>
[src]
Returns the current state of the VM.
pub fn current_machine(&self) -> &Machine<M, P>
[src]
Returns the current runtime machine.
pub fn add_context_history_hook<F: 'static + Fn(&Context)>(&mut self, f: F)
[src]
Add a new context history hook.
Trait Implementations
impl<'a, M: Memory, P: Patch> VM for ContextVM<'a, M, P>
[src]
fn commit_account(
&mut self,
commitment: AccountCommitment
) -> Result<(), CommitError>
[src]
&mut self,
commitment: AccountCommitment
) -> Result<(), CommitError>
fn commit_blockhash(
&mut self,
number: U256,
hash: H256
) -> Result<(), CommitError>
[src]
&mut self,
number: U256,
hash: H256
) -> Result<(), CommitError>
fn status(&self) -> VMStatus
[src]
fn peek(&self) -> Option<Instruction>
[src]
fn peek_opcode(&self) -> Option<Opcode>
[src]
fn step(&mut self) -> Result<(), RequireError>
[src]
fn fire(&mut self) -> Result<(), RequireError>
[src]
fn accounts(&self) -> Values<Address, AccountChange>
[src]
fn used_addresses(&self) -> Set<Address>
[src]
fn out(&self) -> &[u8]
[src]
fn available_gas(&self) -> Gas
[src]
fn refunded_gas(&self) -> Gas
[src]
fn logs(&self) -> &[Log]
[src]
fn removed(&self) -> &[Address]
[src]
fn used_gas(&self) -> Gas
[src]
Auto Trait Implementations
impl<'a, M, P> !Sync for ContextVM<'a, M, P>
impl<'a, M, P> !Send for ContextVM<'a, M, P>
impl<'a, M, P> Unpin for ContextVM<'a, M, P> where
M: Unpin,
M: Unpin,
impl<'a, M, P> !RefUnwindSafe for ContextVM<'a, M, P>
impl<'a, M, P> !UnwindSafe for ContextVM<'a, M, P>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self