revert
Revert the state of the blockchain at the current block.
Usage
ts
import { testClient } from './client'
await testClient.revert({
id: '0x...'
})
import { testClient } from './client'
await testClient.revert({
id: '0x...'
})
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(),
})
Parameters
id
- Type:
"0x${string}"
The snapshot ID.
ts
await testClient.revert({
id: '0x...'
})
await testClient.revert({
id: '0x...'
})