setNextBlockTimestamp
Sets the next block's timestamp.
Usage
ts
import { testClient } from './client'
await testClient.setNextBlockTimestamp({
timestamp: 1671744314n
})
import { testClient } from './client'
await testClient.setNextBlockTimestamp({
timestamp: 1671744314n
})
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
timestamp
- Type:
bigint
ts
await testClient.setNextBlockTimestamp({
timestamp: 1671744314n
})
await testClient.setNextBlockTimestamp({
timestamp: 1671744314n
})
Notes
- The next Block
timestamp
cannot be lesser than the current Blocktimestamp
.