snapshot
Snapshot the state of the blockchain at the current block.
Usage
ts
import { testClient } from './client'
const id = await testClient.snapshot()
import { testClient } from './client'
const id = await testClient.snapshot()
ts
import { createTestClient, http } from 'viem'
import { foundry } from 'viem/chains'
export const testClient = createTestClient({
chain: foundry,
mode: 'anvil',
transport: http(),
})
import { createTestClient, http } from 'viem'
import { foundry } from 'viem/chains'
export const testClient = createTestClient({
chain: foundry,
mode: 'anvil',
transport: http(),
})
Returns
ID of the snapshot that was created.