Skip to content

Commit adade3d

Browse files
committed
Cleanup, add browser tests
1 parent 96a8739 commit adade3d

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.github/workflows/browser.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ jobs:
4747
- run: npm run test:browser -w=@ethereumjs/statemanager
4848
- run: npm run test:browser -w=@ethereumjs/evm
4949
- run: npm run test:browser -w=@ethereumjs/vm
50+
- run: npm run test:browser -w=@ethereumjs/verkle
51+
5052

packages/block/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export { Block } from './block.js'
2-
export { executionPayloadFromBeaconPayload } from './from-beacon-payload.js'
2+
export { BeaconPayloadJson, executionPayloadFromBeaconPayload } from './from-beacon-payload.js'
33
export { BlockHeader } from './header.js'
44
export { getDifficulty, valuesArrayToHeaderData } from './helpers.js'
55
export * from './types.js'

packages/client/test/rpc/engine/kaustinen6.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ describe(`valid verkle network setup`, async () => {
9696
let isBeaconData
9797
if (process.env.SAVED_DATA_DIR !== undefined) {
9898
const fileName = `${process.env.SAVED_DATA_DIR}/${testCase}.json`
99-
testData = JSON.parse(readFileSync(fileName))[testCase]
99+
testData = JSON.parse(readFileSync(fileName, 'utf8'))[testCase]
100100
isBeaconData = false
101101
} else {
102+
// @ts-expect-error -- Typescript complains that `testCase` can't index the `blocks` object
102103
testData = blocks[testCase]
103104
isBeaconData = true
104105
}
@@ -160,8 +161,8 @@ describe(`valid verkle network setup`, async () => {
160161

161162
async function loadGethVectors(vectorsDirPath: string, opts: { common: Common }) {
162163
// set chain id to 1 for geth vectors
163-
opts.common._chainParams.chainId = BigInt(1)
164-
const stateDiffVec = JSON.parse(readFileSync(`${vectorsDirPath}/statediffs.json`))
164+
opts.common['_chainParams'].chainId = BigInt(1)
165+
const stateDiffVec = JSON.parse(readFileSync(`${vectorsDirPath}/statediffs.json`, 'utf8'))
165166
const executionWitness0 = {
166167
stateDiff: [],
167168
verkleProof: {

packages/verkle/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"prepublishOnly": "../../config/cli/prepublish.sh",
4949
"test": "npm run test:node",
5050
"test:node": "npx vitest run",
51+
"test:browser": "npx vitest run --config=../../config/vitest.browser.config.mts",
5152
"tsc": "../../config/cli/ts-compile.sh"
5253
},
5354
"dependencies": {

0 commit comments

Comments
 (0)