# `EEVM.Transaction.Validator`
[🔗](https://github.com/mw2000/eevm/blob/main/lib/eevm/transaction/validator.ex#L1)

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}`.

# `validate`

```elixir
@spec validate(
  EEVM.Context.Transaction.t(),
  EEVM.Database.t(),
  EEVM.Context.Block.t()
) ::
  :ok | {:error, EEVM.Error.transaction_validation_error()}
```

Validate under the default hardfork; see `validate/4`.

# `validate`

```elixir
@spec validate(
  EEVM.Context.Transaction.t(),
  EEVM.Database.t(),
  EEVM.Context.Block.t(),
  EEVM.HardforkConfig.t()
) :: :ok | {:error, EEVM.Error.transaction_validation_error()}
```

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
