Skip to content
On this page

reset

Resets the fork back to its original state.

Import

ts
import { reset } from 'viem/test'

Usage

ts
import { reset } from 'viem/test'
import { testClient } from '.'
 
await reset(testClient) 

Parameters

blockNumber (optional)

  • Type: bigint

Resets the fork to a given block number.

ts
await reset(testClient, {
  blockNumber: 69420n,
  jsonRpcUrl: 'https://mainnet.g.alchemy.com/v2' 
})

jsonRpcUrl (optional)

  • Type: string

Resets the fork with a given JSON RPC URL.

ts
await reset(testClient, {
  blockNumber: 69420n, 
  jsonRpcUrl: 'https://mainnet.g.alchemy.com/v2'
})

Released under the MIT License.