# ExecutedTx.commitTo

Accepts the transaction's state changes and records them in a block.

The same acceptance [`ExecutedTx.commit`](/evm/execution/ExecutedTx/commit) performs, plus the changes are gathered into the accumulator `block` identifies. A token that is not the accumulator in progress is refused, and the transaction stays outstanding rather than committing plainly.

## Imports

:::code-group
```ts [Named]
import { ExecutedTx } from 'ox/evm'
```

```ts [Entrypoint]
import * as ExecutedTx from 'ox/evm/ExecutedTx'
```
:::

## Examples

```ts twoslash
// @noErrors
import { Evm, ExecutedTx } from 'ox/evm'

const block = Evm.startBlockState(evm)

for (const transaction of transactions)
  ExecutedTx.commitTo(Evm.transact(evm, transaction), block)

const state = Evm.takeBlockState(evm, block)
```

## Definition

```ts
function commitTo(
  executed: ExecutedTx,
  block: BlockState.Token,
): TxResult.TxResult
```

**Source:** [src/evm/ExecutedTx.ts](https://github.com/wevm/ox/blob/main/src/evm/ExecutedTx.ts#L160)

## Parameters

### executed

* **Type:** `ExecutedTx`

Executed transaction.

#### executed.'~engine'

* **Type:** `Engine`

#### executed.'~resolved'

* **Type:** `boolean`

#### executed.'~result'

* **Type:** `TxResult`

#### executed.'~token'

* **Type:** `Readonly`

Identifies the transaction this handle was created for. The engine holds it
weakly, discarding the transaction once no handle can reach it.

### block

* **Type:** `BlockState.Token`

Accumulator to record into.

#### block.'~block'

* **Type:** `true`
* **Optional**

## Return Type

The transaction's result.

`TxResult.TxResult`
