EEVM.Transaction.Validator (eevm v0.1.0)

Copy Markdown View Source

Transaction pre-execution validation.

Performs envelope and sender checks in deterministic order against current state and block context, returning :ok or the first {:error, reason}.

Given an EEVM.Config instead of a bare EEVM.HardforkConfig, the checks honour its simulation switches (see EEVM.Config).

Summary

Functions

Like validate/4, but a failure also carries the values the rule compared, as {:error, reason, details}; EEVM.TransactionError lists them per reason.

Validate under the default hardfork; see validate/4.

Run the pre-execution checks in order and return the first failure. Error reasons are listed in EEVM.Error.

Functions

check(tx, db, block, hardfork)

Like validate/4, but a failure also carries the values the rule compared, as {:error, reason, details}; EEVM.TransactionError lists them per reason.

validate(tx, db, block)

Validate under the default hardfork; see validate/4.

validate(tx, db, block, config)

Run the pre-execution checks in order and return the first failure. Error reasons are listed in EEVM.Error.