Skip to content

Commit

Permalink
re-enable anvil backend for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroXbrock committed Nov 7, 2023
1 parent b0fb4a4 commit d94a0f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/utils/formatters/transactionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const rpcTransactionType = {
legacy: '0x0',
eip2930: '0x1',
eip1559: '0x2',
suave: '0x50',
} as const

export type FormatTransactionRequestErrorType = ErrorType
Expand Down
10 changes: 5 additions & 5 deletions test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { fetchLogs } from '@viem/anvil'

import { afterAll, afterEach, beforeAll, beforeEach, vi } from 'vitest'

// import { setIntervalMining } from '~viem/test/index.js'
import { setIntervalMining } from '~viem/test/index.js'
import { cleanupCache, listenersCache } from '~viem/utils/observe.js'
import { promiseCache, responseCache } from '~viem/utils/promise/withCache.js'
import { socketsCache } from '~viem/utils/rpc.js'

import { /*forkBlockNumber,*/ poolId } from './src/constants.js'
// import { setBlockNumber, testClient } from './src/utils.js'
import { forkBlockNumber, poolId } from './src/constants.js'
import { setBlockNumber, testClient } from './src/utils.js'

beforeAll(() => {
vi.mock('../src/errors/utils.ts', () => ({
Expand All @@ -27,14 +27,14 @@ beforeEach(async () => {
cleanupCache.clear()
socketsCache.clear()

// await setIntervalMining(testClient, { interval: 0 })
await setIntervalMining(testClient, { interval: 0 })
})

afterAll(async () => {
vi.restoreAllMocks()

// Reset the anvil instance to the same state it was in before the tests started.
// await setBlockNumber(forkBlockNumber)
await setBlockNumber(forkBlockNumber)
})

afterEach((context) => {
Expand Down

0 comments on commit d94a0f4

Please sign in to comment.