[−][src]Struct ethereumvm::TransactionVM
A VM that executes using a transaction and block information.
Methods
impl<'a, M: Memory, P: Patch> TransactionVM<'a, M, P>
[src]
pub fn new_untrusted(
patch: &'a P,
transaction: UntrustedTransaction,
block: HeaderParams
) -> Result<Self, PreExecutionError>
[src]
patch: &'a P,
transaction: UntrustedTransaction,
block: HeaderParams
) -> Result<Self, PreExecutionError>
Create a VM from an untrusted transaction. It can be any transaction and the VM will return an error if it has errors.
pub fn new(
patch: &'a P,
transaction: ValidTransaction,
block: HeaderParams
) -> Self
[src]
patch: &'a P,
transaction: ValidTransaction,
block: HeaderParams
) -> Self
Create a new VM using the given transaction, block header and patch. This VM runs at the transaction level.
pub fn current_state(&self) -> Option<&State<M, P>>
[src]
Returns the current state of the VM.
pub fn current_machine(&self) -> Option<&Machine<M, P>>
[src]
Returns the current runtime machine.
pub fn with_previous(
transaction: ValidTransaction,
block: HeaderParams,
vm: &TransactionVM<'a, M, P>
) -> Self
[src]
transaction: ValidTransaction,
block: HeaderParams,
vm: &TransactionVM<'a, M, P>
) -> Self
Create a new VM with the result of the previous VM. This is usually used by transaction for chaining them.
pub fn with_states(
patch: &'a P,
transaction: ValidTransaction,
block: HeaderParams,
account_state: AccountState<'a, P::Account>,
blockhash_state: BlockhashState
) -> Self
[src]
patch: &'a P,
transaction: ValidTransaction,
block: HeaderParams,
account_state: AccountState<'a, P::Account>,
blockhash_state: BlockhashState
) -> Self
Create a new VM with the provided account and blockchain states
Trait Implementations
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>
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 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]
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
Auto Trait Implementations
impl<'a, M, P> !Send for TransactionVM<'a, M, P>
impl<'a, M, P> Unpin for TransactionVM<'a, M, P> where
M: Unpin,
M: Unpin,
impl<'a, M, P> !Sync for TransactionVM<'a, M, P>
impl<'a, M, P> !UnwindSafe for TransactionVM<'a, M, P>
impl<'a, M, P> !RefUnwindSafe for TransactionVM<'a, M, P>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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