Struct evm::TransactionVM
[−]
[src]
pub struct TransactionVM<M, P: Patch>(_);
A VM that executes using a transaction and block information.
Methods
impl<M: Memory + Default, P: Patch> TransactionVM<M, P>
[src]
fn new(transaction: ValidTransaction, block: HeaderParams) -> Self
[src]
Create a new VM using the given transaction, block header and patch. This VM runs at the transaction level.
fn with_previous(
transaction: ValidTransaction,
block: HeaderParams,
vm: &TransactionVM<M, P>
) -> Self
[src]
transaction: ValidTransaction,
block: HeaderParams,
vm: &TransactionVM<M, P>
) -> Self
Create a new VM with the result of the previous VM. This is usually used by transaction for chaining them.
fn real_used_gas(&self) -> Gas
[src]
Returns the real used gas by the transaction. This is what is recorded in the transaction receipt.
Trait Implementations
impl<M: Memory + Default, P: Patch> VM for TransactionVM<M, P>
[src]
fn commit_account(
&mut self,
commitment: AccountCommitment
) -> Result<(), CommitError>
[src]
&mut self,
commitment: AccountCommitment
) -> Result<(), CommitError>
Commit an account information to this VM. This should only be used when receiving RequireError
. Read more
fn commit_blockhash(
&mut self,
number: U256,
hash: H256
) -> Result<(), CommitError>
[src]
&mut self,
number: U256,
hash: H256
) -> Result<(), CommitError>
Commit a block hash to this VM. This should only be used when receiving RequireError
. Read more
fn status(&self) -> VMStatus
[src]
Returns the current status of the VM.
fn step(&mut self) -> Result<(), RequireError>
[src]
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. Read more
fn accounts(&self) -> Values<Address, AccountChange>
[src]
Returns the changed or committed accounts information up to current execution status. Read more
fn used_addresses(&self) -> HashSet<Address>
[src]
Returns all fetched or modified addresses.
fn out(&self) -> &[u8]
[src]
Returns the out value, if any.
fn available_gas(&self) -> Gas
[src]
Returns the available gas of this VM.
fn refunded_gas(&self) -> Gas
[src]
Returns the refunded gas of this VM.
fn logs(&self) -> &[Log]
[src]
Returns logs to be appended to the current block if the user decided to accept the running status of this VM. Read more
fn removed(&self) -> &[Address]
[src]
Returns all removed account addresses as for current VM execution.
fn fire(&mut self) -> Result<(), RequireError>
[src]
Run instructions until it reaches a RequireError
or exits. If this function succeeds, the VM status can only be either ExitedOk
or ExitedErr
. Read more