Skip to content

Commit

Permalink
vm: fix vm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrocheleau committed Aug 9, 2024
1 parent 5e1666d commit c754eac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/vm/src/vm.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createBlockchain } from '@ethereumjs/blockchain'
import { Common, Mainnet } from '@ethereumjs/common'
import { createEVM, getActivePrecompiles } from '@ethereumjs/evm'
import { DefaultStateManager } from '@ethereumjs/statemanager'
import { Caches, DefaultStateManager } from '@ethereumjs/statemanager'
import {
Account,
Address,
Expand Down Expand Up @@ -82,7 +82,10 @@ export class VM {
}

if (opts.stateManager === undefined) {
opts.stateManager = new DefaultStateManager({ common: opts.common })
opts.stateManager = new DefaultStateManager({
caches: new Caches(),
common: opts.common,
})
}

if (opts.blockchain === undefined) {
Expand Down
8 changes: 6 additions & 2 deletions packages/vm/test/api/EIPs/eip-6800-verkle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createBlock } from '@ethereumjs/block'
import { Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common'
import { createEVM } from '@ethereumjs/evm'
import { StatelessVerkleStateManager } from '@ethereumjs/statemanager'
import { Caches, StatelessVerkleStateManager } from '@ethereumjs/statemanager'
import { createTxFromSerializedData } from '@ethereumjs/tx'
import { hexToBytes } from '@ethereumjs/util'
import { loadVerkleCrypto } from 'verkle-cryptography-wasm'
Expand Down Expand Up @@ -33,7 +33,11 @@ const block = createBlock({ ...verkleBlockJSON, transactions: decodedTxs } as Bl
describe('EIP 6800 tests', () => {
it('successfully run transactions statelessly using the block witness', async () => {
const verkleCrypto = await loadVerkleCrypto()
const verkleStateManager = new StatelessVerkleStateManager({ common, verkleCrypto })
const verkleStateManager = new StatelessVerkleStateManager({
caches: new Caches(),
common,
verkleCrypto,
})
const evm = await createEVM({ common, stateManager: verkleStateManager })
const vm = await VM.create({
common,
Expand Down

0 comments on commit c754eac

Please sign in to comment.