> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# testing: EVM test chain

> EVM test chain: the declaration and description of each of the 7 exports of @eco-incorp/sauce/testing.

`@eco-incorp/sauce/testing` runs programs on a local chain inside a test, in Node only. `fork(chain, options)` starts a copy of a real chain (an EVM chain at `options.block`) with the Sauce release, replaying a recorded state file, recording one, or reading the live chain; `local(options?)` starts an empty chain (Base unless `options.chain` names another, Solana included) with the Sauce release deployed and no Kitchen fee. An EVM chain runs on Foundry's `anvil`, which must be on `PATH`; Solana runs in LiteSVM.

```typescript theme={null}
import { fork, local, CookReverted } from "@eco-incorp/sauce/testing";
```

Generated from the type declarations of `@eco-incorp/sauce`.

### `TestChain`

*Class* · `@eco-incorp/sauce/testing`

```typescript theme={null}
export declare class TestChain {
    readonly chain: CanonicalChain;
    readonly rpcUrl: string;
    readonly mode: "replay" | "record" | "live" | "local";
    readonly stack: Stack;
    private readonly stopNode;
    readonly client: PublicClient;
    readonly test: TestClient;
    private readonly viemChain;
    private readonly snapshots;
    private readonly accounts;
    constructor(chain: CanonicalChain, rpcUrl: string, mode: "replay" | "record" | "live" | "local", stack: Stack, stopNode: () => Promise<void>);
    get engine(): Address;
    get kitchen(): Address;
    get router(): Address;
    get nativeSymbol(): string;
    account(index?: number): TestAccount;
    private accountOf;
    executionFee(): Promise<bigint>;
    deployPot(account?: number | TestAccount): Promise<Address>;
    private wallet;
    private token;
    private decimals;
    balanceOf(holder: Address, token: string): Promise<bigint>;
    fund(holder: Address, amounts: Readonly<Record<string, string | bigint>>): Promise<void>;
    impersonate<T>(address: Address, body: (send: (tx: {
        to: Address;
        data?: Hex;
        value?: bigint;
    }) => Promise<Hex>) => Promise<T>): Promise<T>;
    compile(program: ProgramInput): CompiledProgram;
    private cookCall;
    private result;
    simulate(program: ProgramInput, options?: CookOptions): Promise<CookResult>;
    run(program: ProgramInput, options?: CookOptions): Promise<CookResult>;
    snapshot(): Promise<void>;
    revert(): Promise<void>;
    increaseTime(seconds: number | bigint): Promise<void>;
    mine(blocks?: number): Promise<void>;
    now(): Promise<bigint>;
    stop(): Promise<void>;
}
```

### `DEFAULT_POT_SALT`

*Variable* · `@eco-incorp/sauce/testing`

The salt `sauce pot` and `sauce run` use when given none.

```typescript theme={null}
DEFAULT_POT_SALT: Hex
```

### `CookOptions`

*Interface* · `@eco-incorp/sauce/testing`

```typescript theme={null}
export interface CookOptions {
    readonly from?: number | TestAccount;
    readonly args?: readonly EntryValue[];
    readonly value?: bigint;
}
```

### `CookResult`

*Interface* · `@eco-incorp/sauce/testing`

```typescript theme={null}
export interface CookResult {
    readonly hash?: Hex;
    readonly gasUsed: bigint;
    readonly returnData: Hex;
    readonly returned: Value | undefined;
    readonly transfers: readonly Movement[];
    readonly effects: Effects;
    delta(holder: Address, token: string): bigint;
}
```

### `TestAccount`

*Interface* · `@eco-incorp/sauce/testing`

```typescript theme={null}
export interface TestAccount {
    readonly index: number;
    readonly address: Address;
    readonly privateKey: Hex;
    readonly pot: Address;
}
```

### `Effects`

*Interface* · `@eco-incorp/sauce/testing`

```typescript theme={null}
export interface Effects {
    readonly moves: readonly Movement[];
    readonly transfers: readonly Movement[];
    readonly approvals: readonly ApprovalEvent[];
    readonly native?: readonly Movement[];
    readonly changes: readonly BalanceChange[];
    readonly other: readonly RawLog[];
    readonly tokens: ReadonlyMap<string, TokenInfo>;
    readonly labels: ReadonlyMap<string, string>;
}
```

### `Movement`

*Interface* · `@eco-incorp/sauce/testing`

```typescript theme={null}
export interface Movement {
    readonly token: Address | "native";
    readonly from: Address;
    readonly to: Address;
    readonly amount: bigint;
    readonly kind: "transfer" | "wrap" | "unwrap";
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.