[][src]Trait libra_vm::VMValidator

pub trait VMValidator {
    fn validate_transaction(
        &self,
        transaction: SignedTransaction,
        state_view: &dyn StateView
    ) -> VMValidatorResult; }

This trait describes the VM's validation interfaces.

Required methods

fn validate_transaction(
    &self,
    transaction: SignedTransaction,
    state_view: &dyn StateView
) -> VMValidatorResult

Executes the prologue of the Libra Account and verifies that the transaction is valid.

Loading content...

Implementors

impl VMValidator for LibraVMValidator[src]

fn validate_transaction(
    &self,
    transaction: SignedTransaction,
    state_view: &dyn StateView
) -> VMValidatorResult
[src]

Determine if a transaction is valid. Will return None if the transaction is accepted, Some(Err) if the VM rejects it, with Err as an error code. Verification performs the following steps:

  1. The signature on the SignedTransaction matches the public key included in the transaction
  2. The script to be executed is under given specific configuration.
  3. Invokes LibraAccount.prologue, which checks properties such as the transaction has the right sequence number and the sender has enough balance to pay for the gas. TBD:
  4. Transaction arguments matches the main function's type signature. We don't check this item for now and would execute the check at execution time.
Loading content...