[][src]Struct ethereumvm::TransactionVM

pub struct TransactionVM<'a, M, P: Patch>(_);

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]

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]

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]

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]

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 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

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]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self