From 2cf4ddbec25d459734d540c9e435df132368004f Mon Sep 17 00:00:00 2001 From: Gabriel Rocheleau Date: Fri, 13 Sep 2024 02:38:02 -0400 Subject: [PATCH] monorepo: add tsc to ci (#3661) * monorepo: add tsc to ci * monorepo: attempt fixing yml config * add tsc / typecheck to ci * add eth-tests step * fix type issues * remove extraneous file * update vitest to 2.1 * add submodule key to typecheck job * more ci fixes * add proper return value --------- Co-authored-by: Jochem Brouwer Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com> --- .github/workflows/build.yml | 10 +- .github/workflows/typecheck.yml | 62 +++++ package-lock.json | 258 ++++++++++-------- package.json | 8 +- packages/client/test/client.spec.ts | 8 +- .../test/integration/beaconsync.spec.ts | 4 +- .../client/test/miner/pendingBlock.spec.ts | 4 +- .../client/test/net/server/rlpxserver.spec.ts | 8 +- packages/rlp/test/integration.spec.ts | 2 +- packages/rlp/test/invalid.spec.ts | 2 +- packages/rlp/test/official.spec.ts | 2 +- packages/vm/test/api/runBlock.spec.ts | 2 +- 12 files changed, 230 insertions(+), 140 deletions(-) create mode 100644 .github/workflows/typecheck.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee25fac806..1ed240126c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -194,4 +194,12 @@ jobs: uses: ./.github/workflows/lint.yml with: dep-cache-key: ${{ needs.build.outputs.dep-cache-key }} - \ No newline at end of file + + typecheck: + needs: [build, checkout-submodules] + uses: ./.github/workflows/typecheck.yml + with: + dep-cache-key: ${{ needs.build.outputs.dep-cache-key }} + submodule-cache-key: ${{ needs.checkout-submodules.outputs.submodule-cache-key }} + + \ No newline at end of file diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml new file mode 100644 index 0000000000..dc6776ce24 --- /dev/null +++ b/.github/workflows/typecheck.yml @@ -0,0 +1,62 @@ +name: Typecheck (tsc) +on: + workflow_call: + inputs: + dep-cache-key: + required: true + type: string + submodule-cache-key: + required: true + type: string + workflow_dispatch: + inputs: + dep-cache-key: + required: false + default: 'none' + submodule-cache-key: + required: false + default: 'none' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-typecheck + cancel-in-progress: true + +jobs: + typecheck: + runs-on: ubuntu-latest + steps: + # We clone the repo and submodules if triggered from work-flow dispatch + - if: inputs.submodule-cache-key == 'none' + uses: actions/checkout@v4 + + # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) + - if: inputs.dep-cache-key != 'none' + uses: actions/cache/restore@v4 + id: dep-cache + with: + path: ${{github.workspace}} + key: ${{ inputs.dep-cache-key }} + + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install Dependencies (if not restored from cache) + if: steps.dep-cache.outputs.cache-hit != 'true' + run: npm ci + working-directory: ${{ github.workspace }} + + - if: inputs.submodule-cache-key != 'none' + uses: actions/cache/restore@v4 + name: Initialize ethereum-tests + id: submodules-cache + with: + path: ${{github.workspace}}/packages/ethereum-tests + key: ${{ inputs.submodule-cache-key}} + fail-on-cache-miss: true + + + - run: npm run tsc --workspaces + working-directory: ${{ github.workspace }} diff --git a/package-lock.json b/package-lock.json index 052efbdcf2..5dd52904ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,8 +15,8 @@ "@types/tape": "4.13.2", "@typescript-eslint/eslint-plugin": "5.33.1", "@typescript-eslint/parser": "5.33.1", - "@vitest/coverage-v8": "^v2.0.0", - "@vitest/ui": "^v2.0.0", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "7.12.0", "cspell": "^8.13.3", "embedme": "1.22.1", @@ -43,7 +43,7 @@ "vite-plugin-node-polyfills": "^0.21.0", "vite-plugin-top-level-await": "^1.4.1", "vite-plugin-wasm": "^3.3.0", - "vitest": "^v2.0.0" + "vitest": "^2.1.0" }, "engines": { "node": ">=18", @@ -53,7 +53,7 @@ "@rollup/rollup-linux-x64-gnu": "*" }, "peerDependencies": { - "@vitest/browser": "^v2.0.0", + "@vitest/browser": "2.1.0", "webdriverio": "^8.39.0" }, "peerDependenciesMeta": { @@ -3614,19 +3614,19 @@ "dev": true }, "node_modules/@vitest/coverage-v8": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.0.5.tgz", - "integrity": "sha512-qeFcySCg5FLO2bHHSa0tAZAOnAUbp4L6/A5JDuj9+bt53JREl8hpLjLHEWF0e/gWc8INVpJaqA7+Ene2rclpZg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.0.tgz", + "integrity": "sha512-yqCkr2nrV4o58VcVMxTVkS6Ggxzy7pmSD8JbTbhbH5PsQfUIES1QT716VUzo33wf2lX9EcWYdT3Vl2MMmjR59g==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.3.0", "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.5", + "debug": "^4.3.6", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-lib-source-maps": "^5.0.6", "istanbul-reports": "^3.1.7", - "magic-string": "^0.30.10", + "magic-string": "^0.30.11", "magicast": "^0.3.4", "std-env": "^3.7.0", "test-exclude": "^7.0.1", @@ -3636,17 +3636,23 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "2.0.5" + "@vitest/browser": "2.1.0", + "vitest": "2.1.0" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + } } }, "node_modules/@vitest/expect": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.5.tgz", - "integrity": "sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.0.tgz", + "integrity": "sha512-N3/xR4fSu0+6sVZETEtPT1orUs2+Y477JOXTcU3xKuu3uBlsgbD7/7Mz2LZ1Jr1XjwilEWlrIgSCj4N1+5ZmsQ==", "dev": true, "dependencies": { - "@vitest/spy": "2.0.5", - "@vitest/utils": "2.0.5", + "@vitest/spy": "2.1.0", + "@vitest/utils": "2.1.0", "chai": "^5.1.1", "tinyrainbow": "^1.2.0" }, @@ -3654,10 +3660,37 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/@vitest/mocker": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.0.tgz", + "integrity": "sha512-ZxENovUqhzl+QiOFpagiHUNUuZ1qPd5yYTCYHomGIZOFArzn4mgX2oxZmiAItJWAaXHG6bbpb/DpSPhlk5DgtA==", + "dev": true, + "dependencies": { + "@vitest/spy": "^2.1.0-beta.1", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.11" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@vitest/spy": "2.1.0", + "msw": "^2.3.5", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, "node_modules/@vitest/pretty-format": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.5.tgz", - "integrity": "sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.0.tgz", + "integrity": "sha512-7sxf2F3DNYatgmzXXcTh6cq+/fxwB47RIQqZJFoSH883wnVAoccSRT6g+dTKemUBo8Q5N4OYYj1EBXLuRKvp3Q==", "dev": true, "dependencies": { "tinyrainbow": "^1.2.0" @@ -3667,12 +3700,12 @@ } }, "node_modules/@vitest/runner": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.0.5.tgz", - "integrity": "sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.0.tgz", + "integrity": "sha512-D9+ZiB8MbMt7qWDRJc4CRNNUlne/8E1X7dcKhZVAbcOKG58MGGYVDqAq19xlhNfMFZsW0bpVKgztBwks38Ko0w==", "dev": true, "dependencies": { - "@vitest/utils": "2.0.5", + "@vitest/utils": "2.1.0", "pathe": "^1.1.2" }, "funding": { @@ -3680,13 +3713,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.0.5.tgz", - "integrity": "sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.0.tgz", + "integrity": "sha512-x69CygGMzt9VCO283K2/FYQ+nBrOj66OTKpsPykjCR4Ac3lLV+m85hj9reaIGmjBSsKzVvbxWmjWE3kF5ha3uQ==", "dev": true, "dependencies": { - "@vitest/pretty-format": "2.0.5", - "magic-string": "^0.30.10", + "@vitest/pretty-format": "2.1.0", + "magic-string": "^0.30.11", "pathe": "^1.1.2" }, "funding": { @@ -3694,9 +3727,9 @@ } }, "node_modules/@vitest/spy": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.0.5.tgz", - "integrity": "sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.0.tgz", + "integrity": "sha512-IXX5NkbdgTYTog3F14i2LgnBc+20YmkXMx0IWai84mcxySUDRgm0ihbOfR4L0EVRBDFG85GjmQQEZNNKVVpkZw==", "dev": true, "dependencies": { "tinyspy": "^3.0.0" @@ -3706,34 +3739,33 @@ } }, "node_modules/@vitest/ui": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-2.0.5.tgz", - "integrity": "sha512-m+ZpVt/PVi/nbeRKEjdiYeoh0aOfI9zr3Ria9LO7V2PlMETtAXJS3uETEZkc8Be2oOl8mhd7Ew+5SRBXRYncNw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-2.1.0.tgz", + "integrity": "sha512-e1kSwO6/D65TDRxi/rdeFRNUhCfKMWhA7dFZbc3AvLNw+HLvbTkYUvF/ldGtqGPghiHyYw/crMsA2CiT9S86Rg==", "dev": true, "dependencies": { - "@vitest/utils": "2.0.5", - "fast-glob": "^3.3.2", + "@vitest/utils": "2.1.0", "fflate": "^0.8.2", "flatted": "^3.3.1", "pathe": "^1.1.2", "sirv": "^2.0.4", + "tinyglobby": "^0.2.6", "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "2.0.5" + "vitest": "2.1.0" } }, "node_modules/@vitest/utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.0.5.tgz", - "integrity": "sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.0.tgz", + "integrity": "sha512-rreyfVe0PuNqJfKYUwfPDfi6rrp0VSu0Wgvp5WBqJonP+4NvXHk48X6oBam1Lj47Hy6jbJtnMj3OcRdrkTP0tA==", "dev": true, "dependencies": { - "@vitest/pretty-format": "2.0.5", - "estree-walker": "^3.0.3", + "@vitest/pretty-format": "2.1.0", "loupe": "^3.1.1", "tinyrainbow": "^1.2.0" }, @@ -12740,6 +12772,51 @@ "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", "dev": true }, + "node_modules/tinyexec": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.0.tgz", + "integrity": "sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==", + "dev": true + }, + "node_modules/tinyglobby": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.6.tgz", + "integrity": "sha512-NbBoFBpqfcgd1tCiO8Lkfdk+xrA7mlLR9zgvZcZWQQwU63XAfUePyd6wZBaU93Hqw347lHnwFzttAkemHzzz4g==", + "dev": true, + "dependencies": { + "fdir": "^6.3.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.3.0.tgz", + "integrity": "sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==", + "dev": true, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tinypool": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz", @@ -13334,15 +13411,14 @@ } }, "node_modules/vite-node": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.0.5.tgz", - "integrity": "sha512-LdsW4pxj0Ot69FAoXZ1yTnA9bjGohr2yNBU7QKRxpz8ITSkhuDl6h3zS/tvgz4qrNjeRnvrWeXQ8ZF7Um4W00Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.0.tgz", + "integrity": "sha512-+ybYqBVUjYyIscoLzMWodus2enQDZOpGhcU6HdOVD6n8WZdk12w1GFL3mbnxLs7hPtRtqs1Wo5YF6/Tsr6fmhg==", "dev": true, "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.5", + "debug": "^4.3.6", "pathe": "^1.1.2", - "tinyrainbow": "^1.2.0", "vite": "^5.0.0" }, "bin": { @@ -13849,29 +13925,29 @@ } }, "node_modules/vitest": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.0.5.tgz", - "integrity": "sha512-8GUxONfauuIdeSl5f9GTgVEpg5BTOlplET4WEDaeY2QBiN8wSm68vxN/tb5z405OwppfoCavnwXafiaYBC/xOA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.0.tgz", + "integrity": "sha512-XuuEeyNkqbfr0FtAvd9vFbInSSNY1ykCQTYQ0sj9wPy4hx+1gR7gqVNdW0AX2wrrM1wWlN5fnJDjF9xG6mYRSQ==", "dev": true, "dependencies": { - "@ampproject/remapping": "^2.3.0", - "@vitest/expect": "2.0.5", - "@vitest/pretty-format": "^2.0.5", - "@vitest/runner": "2.0.5", - "@vitest/snapshot": "2.0.5", - "@vitest/spy": "2.0.5", - "@vitest/utils": "2.0.5", + "@vitest/expect": "2.1.0", + "@vitest/mocker": "2.1.0", + "@vitest/pretty-format": "^2.1.0", + "@vitest/runner": "2.1.0", + "@vitest/snapshot": "2.1.0", + "@vitest/spy": "2.1.0", + "@vitest/utils": "2.1.0", "chai": "^5.1.1", - "debug": "^4.3.5", - "execa": "^8.0.1", - "magic-string": "^0.30.10", + "debug": "^4.3.6", + "magic-string": "^0.30.11", "pathe": "^1.1.2", "std-env": "^3.7.0", - "tinybench": "^2.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.0", "tinypool": "^1.0.0", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.0.5", + "vite-node": "2.1.0", "why-is-node-running": "^2.3.0" }, "bin": { @@ -13886,8 +13962,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.0.5", - "@vitest/ui": "2.0.5", + "@vitest/browser": "2.1.0", + "@vitest/ui": "2.1.0", "happy-dom": "*", "jsdom": "*" }, @@ -13912,62 +13988,6 @@ } } }, - "node_modules/vitest/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/vitest/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/vitest/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", diff --git a/package.json b/package.json index bf1c304f0d..8b3eb76fe8 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,8 @@ "@types/tape": "4.13.2", "@typescript-eslint/eslint-plugin": "5.33.1", "@typescript-eslint/parser": "5.33.1", - "@vitest/coverage-v8": "^v2.0.0", - "@vitest/ui": "^v2.0.0", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "7.12.0", "cspell": "^8.13.3", "embedme": "1.22.1", @@ -62,13 +62,13 @@ "vite-plugin-node-polyfills": "^0.21.0", "vite-plugin-top-level-await": "^1.4.1", "vite-plugin-wasm": "^3.3.0", - "vitest": "^v2.0.0" + "vitest": "^2.1.0" }, "optionalDependencies": { "@rollup/rollup-linux-x64-gnu": "*" }, "peerDependencies": { - "@vitest/browser": "^v2.0.0", + "@vitest/browser": "2.1.0", "webdriverio": "^8.39.0" }, "peerDependenciesMeta": { diff --git a/packages/client/test/client.spec.ts b/packages/client/test/client.spec.ts index 21050598d7..3ed72e9f87 100644 --- a/packages/client/test/client.spec.ts +++ b/packages/client/test/client.spec.ts @@ -19,8 +19,8 @@ describe('[EthereumClient]', async () => { FullEthereumService.prototype.start = vi.fn().mockResolvedValue(null) FullEthereumService.prototype.stop = vi.fn().mockResolvedValue(null) vi.doMock('../src/service/index.js', () => { - { - FullEthereumService + return { + FullEthereumService, } }) @@ -35,8 +35,8 @@ describe('[EthereumClient]', async () => { Server.prototype.stop = vi.fn().mockResolvedValue(null) Server.prototype.bootstrap = vi.fn().mockResolvedValue(null) vi.doMock('../src/net/server/server.js', () => { - { - Server + return { + Server, } }) diff --git a/packages/client/test/integration/beaconsync.spec.ts b/packages/client/test/integration/beaconsync.spec.ts index 69b07ac2f7..de3a673a03 100644 --- a/packages/client/test/integration/beaconsync.spec.ts +++ b/packages/client/test/integration/beaconsync.spec.ts @@ -13,8 +13,8 @@ common.setHardforkBy({ blockNumber: BigInt(0) }) describe('should sync blocks', async () => { BlockHeader.prototype['_consensusFormatValidation'] = vi.fn() vi.doMock('@ethereumjs/block', () => { - { - BlockHeader + return { + BlockHeader, } }) diff --git a/packages/client/test/miner/pendingBlock.spec.ts b/packages/client/test/miner/pendingBlock.spec.ts index be92a1baa0..f4b38978a8 100644 --- a/packages/client/test/miner/pendingBlock.spec.ts +++ b/packages/client/test/miner/pendingBlock.spec.ts @@ -92,8 +92,8 @@ const setup = () => { describe('[PendingBlock]', async () => { BlockHeader.prototype['_consensusFormatValidation'] = vi.fn() vi.doMock('@ethereumjs/block', () => { - { - BlockHeader + return { + BlockHeader, } }) diff --git a/packages/client/test/net/server/rlpxserver.spec.ts b/packages/client/test/net/server/rlpxserver.spec.ts index e57abe7c0a..73985f131b 100644 --- a/packages/client/test/net/server/rlpxserver.spec.ts +++ b/packages/client/test/net/server/rlpxserver.spec.ts @@ -24,8 +24,8 @@ RlpxPeer.prototype.accept = vi.fn((input: object) => { }) RlpxPeer.capabilities = vi.fn() vi.doMock('../../../src/net/peer/rlpxpeer', () => { - { - RlpxPeer + return { + RlpxPeer, } }) @@ -41,8 +41,8 @@ DPT.prototype.bind = vi.fn() DPT.prototype.getDnsPeers = vi.fn() vi.doMock('@ethereumjs/devp2p', () => { - { - RLPx + return { + RLPx, } }) diff --git a/packages/rlp/test/integration.spec.ts b/packages/rlp/test/integration.spec.ts index 4cb3a5186d..a2a94068c2 100644 --- a/packages/rlp/test/integration.spec.ts +++ b/packages/rlp/test/integration.spec.ts @@ -30,7 +30,7 @@ describe.skipIf(isBrowser)('CLI command', () => { it( 'should return valid values for official tests', async () => { - for (const [testName, test] of Object.entries(official.tests)) { + for (const [testName, test] of Object.entries(official.default.tests)) { const { in: incoming, out } = test // skip if testing a big number diff --git a/packages/rlp/test/invalid.spec.ts b/packages/rlp/test/invalid.spec.ts index ed107b8026..dfa8c728d9 100644 --- a/packages/rlp/test/invalid.spec.ts +++ b/packages/rlp/test/invalid.spec.ts @@ -7,7 +7,7 @@ import * as invalid from './fixture/invalid.json' const { hexToBytes } = utils describe('invalid tests', () => { - for (const [testName, test] of Object.entries(invalid.tests)) { + for (const [testName, test] of Object.entries(invalid.default.tests)) { it(`should pass ${testName}`, () => { let { out } = test if (out[0] === '0' && out[1] === 'x') { diff --git a/packages/rlp/test/official.spec.ts b/packages/rlp/test/official.spec.ts index 9f8aef85ef..99ce65d972 100644 --- a/packages/rlp/test/official.spec.ts +++ b/packages/rlp/test/official.spec.ts @@ -8,7 +8,7 @@ import { numberToBytes } from './utils.js' const { bytesToHex, hexToBytes } = utils describe('official tests', () => { - for (const [testName, test] of Object.entries(official.tests)) { + for (const [testName, test] of Object.entries(official.default.tests)) { it(`should pass ${testName}`, () => { let incoming: any = test.in // if we are testing a big number diff --git a/packages/vm/test/api/runBlock.spec.ts b/packages/vm/test/api/runBlock.spec.ts index 29d817c562..bb62396287 100644 --- a/packages/vm/test/api/runBlock.spec.ts +++ b/packages/vm/test/api/runBlock.spec.ts @@ -606,7 +606,7 @@ describe('runBlock() -> tx types', async () => { const chainIdBytes = unpadBytes(hexToBytes(`0x${chainId.toString(16)}`)) const nonceBytes = - nonce !== undefined ? [unpadBytes(hexToBytes(`0x${nonce.toString(16)}`))] : [] + nonce !== undefined ? unpadBytes(hexToBytes(`0x${nonce.toString(16)}`)) : new Uint8Array() const addressBytes = address.toBytes() const rlpdMsg = RLP.encode([chainIdBytes, addressBytes, nonceBytes])