> ## 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: Solana test chain

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

### `SolanaTestChain`

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

```typescript theme={null}
export declare class SolanaTestChain {
    readonly chain: CanonicalChain;
    readonly mode: "replay" | "record" | "live" | "local";
    private readonly bank;
    readonly engine: Address;
    readonly kitchen: Address;
    private readonly feeConfig;
    private readonly signers;
    private readonly accounts;
    private readonly funder;
    private readonly cookChain;
    private recordTo;
    private constructor();
    static start(chain: CanonicalChain, bank: Bank, options: {
        readonly zeroFee?: boolean;
        readonly recordTo?: {
            readonly path: string;
            readonly rpcUrl: string;
        };
    }): Promise<SolanaTestChain>;
    account(index?: number): SolanaTestAccount;
    private accountOf;
    executionFee(): Promise<bigint>;
    deployPot(account?: number | SolanaTestAccount): Promise<Address>;
    getAccount(key: Address): Promise<SolanaAccount | null>;
    setAccount(key: Address, account: SolanaAccount | null): Promise<void>;
    private tokenOf;
    balanceOf(holder: Address, token: string): Promise<bigint>;
    fund(holder: Address, amounts: Readonly<Record<string, string | bigint>>): Promise<void>;
    compile(program: ProgramInput): CompiledProgram;
    private tokenName;
    private changesOf;
    private mintOf;
    private result;
    private cook;
    run(program: ProgramInput, options?: SolanaCookOptions): Promise<SolanaCookResult>;
    simulate(program: ProgramInput, options?: SolanaCookOptions): Promise<SolanaCookResult>;
    snapshot(): Promise<void>;
    revert(): Promise<void>;
    increaseTime(seconds: number | bigint): Promise<void>;
    warp(slots: number | bigint): Promise<void>;
    now(): Promise<bigint>;
    slot(): Promise<bigint>;
    stop(): Promise<void>;
}
```

### `SolanaAccount`

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

An account as the chain holds it.

```typescript theme={null}
export interface SolanaAccount {
    readonly lamports: bigint;
    readonly owner: Address;
    readonly data: Uint8Array;
    readonly executable: boolean;
}
```

### `SolanaChange`

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

How much one holder's balance of one token changed.

```typescript theme={null}
export interface SolanaChange {
    readonly holder: Address;
    readonly token: string;
    readonly mint?: Address;
    readonly amount: bigint;
}
```

### `SolanaCookOptions`

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

```typescript theme={null}
export interface SolanaCookOptions {
    readonly from?: number | SolanaTestAccount;
    readonly args?: readonly EntryValue[];
    readonly accounts?: Readonly<Record<string, string>>;
}
```

### `SolanaCookResult`

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

```typescript theme={null}
export interface SolanaCookResult {
    readonly signature?: string;
    readonly computeUnits: bigint;
    readonly returnData: Hex;
    readonly returned: Value | undefined;
    readonly logs: readonly string[];
    readonly changes: readonly SolanaChange[];
    readonly staged: boolean;
    readonly lookupTable: boolean;
    delta(holder: Address, token: string): bigint;
}
```

### `SolanaForkOptions`

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

```typescript theme={null}
export interface SolanaForkOptions {
    readonly state?: string;
    readonly rpcUrl?: string;
    readonly mode?: "auto" | ForkMode;
    readonly zeroFee?: boolean;
}
```

### `SolanaTestAccount`

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

```typescript theme={null}
export interface SolanaTestAccount {
    readonly index: number;
    readonly address: Address;
    readonly secretKey: Uint8Array;
    readonly pot: Address;
}
```


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