Skip to content
On this page

revert

Revert the state of the blockchain at the current block.

Usage

ts
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(), 
})

Parameters

id

  • Type: "0x${string}"

The snapshot ID.

ts
await testClient.revert({
  id: '0x...' 
})

Released under the MIT License.