Struct sputnikvm::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 current_state(&self) -> Option<&State<M, P>>
[src]
Returns the current state of the VM.
fn current_machine(&self) -> Option<&Machine<M, P>>
[src]
Returns the current runtime machine.
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 peek(&self) -> Option<Instruction>
[src]
Read the next instruction to be executed.
fn peek_opcode(&self) -> Option<Opcode>
[src]
Read the next opcode to be executed.
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) -> Set<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 used_gas(&self) -> Gas
[src]
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. Read more
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