[−][src]Trait ethereumvm::VM
Represents an EVM. This is usually the main interface for clients to interact with.
Required methods
fn commit_account(
&mut self,
commitment: AccountCommitment
) -> Result<(), CommitError>
&mut self,
commitment: AccountCommitment
) -> Result<(), CommitError>
Commit an account information to this VM. This should only
be used when receiving RequireError
.
fn commit_blockhash(
&mut self,
number: U256,
hash: H256
) -> Result<(), CommitError>
&mut self,
number: U256,
hash: H256
) -> Result<(), CommitError>
Commit a block hash to this VM. This should only be used when
receiving RequireError
.
fn status(&self) -> VMStatus
Returns the current status of the VM.
fn peek(&self) -> Option<Instruction>
Read the next instruction to be executed.
fn peek_opcode(&self) -> Option<Opcode>
Read the next opcode to be executed.
fn step(&mut self) -> Result<(), RequireError>
Run one instruction and return. If it succeeds, VM status can
still be Running
. If the call stack has more than one items,
this will only executes the last items' one single
instruction.
fn accounts(&self) -> Values<Address, AccountChange>
Returns the changed or committed accounts information up to current execution status.
fn used_addresses(&self) -> Set<Address>
Returns all fetched or modified addresses.
fn out(&self) -> &[u8]
Returns the out value, if any.
fn available_gas(&self) -> Gas
Returns the available gas of this VM.
fn refunded_gas(&self) -> Gas
Returns the refunded gas of this VM.
fn logs(&self) -> &[Log]
Returns logs to be appended to the current block if the user decided to accept the running status of this VM.
fn removed(&self) -> &[Address]
Returns all removed account addresses as for current VM execution.
fn used_gas(&self) -> Gas
Returns the real used gas by the transaction or the VM context. Only available when the status of the VM is exited. Otherwise returns zero.
Provided methods
fn fire(&mut self) -> Result<(), RequireError>
Run instructions until it reaches a RequireError
or
exits. If this function succeeds, the VM status can only be
either ExitedOk
or ExitedErr
.
Implementors
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]
impl<'a, M: Memory, P: Patch> VM for TransactionVM<'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>