-
-
Notifications
You must be signed in to change notification settings - Fork 410
fix: this PR fixes Issue #6632 #8571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c630189
Fix:allow voluntary-exit-command-to-write-to-file rather than publish
edna-harriet afa470b
Add voluntaryExit write-to-file manual node test and PR documentation
edna-harriet 4afe1df
added 2 test passes
edna-harriet d1faec8
added 2 tests for voluntaryExit write to file command and no data is …
edna-harriet a5d6b98
removed file voluntaryExit.saveToFile-noNetwork.ts
edna-harriet e589e06
modified creation of temporary test directory
edna-harriet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Pull Request:Allow Voluntary Exit To Write-to-File Feature and Prepare a manual node Test. | ||
|
|
||
| ## Summary | ||
| This PR adds a `--saveToFile` JSON file option to the validator `voluntary-exit` command for later submission workflows. It does not submit to the beacon node. | ||
|
|
||
|
|
||
| ## Changes Made | ||
| 1. packages/cli/src/cmds/validator/voluntaryExit.ts` — implement saveToFile behavior | ||
| 2. packages/cli/manual-tests/voluntaryExit.writefile.test.js` — manual script that: | ||
| -runs the handler with `saveToFile` | ||
| -verifies the file is created and readable. | ||
| -submits to a mock beacon client rather than publish to network. | ||
|
|
||
| > **Note:** The manual test demonstrates the behavior and was run locally.I kept the manual script so reviewers can quickly run and validate.I'm working on Jest/CI setup. I’d appreciate guidance or help from maintainers about the preferred location/approach for the automated test in repo CI. | ||
| ## How to run the node test manually: | ||
|
|
||
| From repo root, run: | ||
| -$yarn install | ||
| -$yarn build | ||
| -$yarn workspace @chainsafe/lodestar node packages/cli/manual-tests/voluntaryExit.writefile.test.js | ||
|
|
||
| ## Expected Output: | ||
| ✅ File created successfully: .../manual-tests/exit-test.json | ||
| 📄 File content: { message: 'Mock voluntary exit data' } | ||
| 📨 Mock beacon received voluntary exit: { message: 'Mock voluntary exit data' } | ||
| ✅ Voluntary exit successfully submitted to mock beacon client. | ||
| 🧹 Cleaned up test file. | ||
|
|
||
| ## Why manual test included: | ||
| While authoring an automated Jest test I ran into some repository-specific Jest/ESM config complexity. The manual test is included to provide clear, reproducible proof of functionality . It also aims to: | ||
| (a) let reviewers run the feature instantly. | ||
| (b) improve it to adapt to the repo's CI. | ||
|
|
||
| ## Assistance needed: | ||
| I would appreciate guidance on: | ||
| - Correct integration testing pattern for Lodestar CLI commands.(I am happy to follow maintainers' suggestions to convert into an automated test). | ||
| - Ensuring that my local Jest configuration aligns with Lodestar’s monorepo test standards. | ||
|
|
||
| ## To Do. | ||
| - Convert manual test to an automated Jest integration test in packages/cli/test/validator. | ||
| - Add any required test harness / mocks used by repo CI. | ||
|
|
||
| ## Additional Notes | ||
| I’m learning to contribute to Ethereum core tooling via Lodestar, and this PR forms part of my contribution proof and learning process. | ||
|
|
||
| Thank you for reviewing, I look forward to reading your feedbacks. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import tseslint from "typescript-eslint"; | ||
|
|
||
| export default tseslint.config([ | ||
| { | ||
| files: ["**/*.ts", "**/*.js"], | ||
| ignores: ["node_modules/**", "dist/**"], | ||
| languageOptions: { | ||
| parser: tseslint.parser, | ||
| }, | ||
| plugins: { | ||
| "@typescript-eslint": tseslint.plugin, | ||
| }, | ||
| rules: { | ||
| semi: ["error", "always"], | ||
| quotes: ["error", "double"], | ||
| "@typescript-eslint/no-unused-vars": ["warn"], | ||
| }, | ||
| }, | ||
| ]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import js from "@eslint/js"; | ||
| import globals from "globals"; | ||
| import tseslint from "typescript-eslint"; | ||
| import json from "@eslint/json"; | ||
| import markdown from "@eslint/markdown"; | ||
| import { defineConfig } from "eslint/config"; | ||
|
|
||
| export default defineConfig([ | ||
| { files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], plugins: { js }, extends: ["js/recommended"], languageOptions: { globals: globals.browser } }, | ||
| tseslint.configs.recommended, | ||
| { files: ["**/*.json"], plugins: { json }, language: "json/json", extends: ["json/recommended"] }, | ||
| { files: ["**/*.jsonc"], plugins: { json }, language: "json/jsonc", extends: ["json/recommended"] }, | ||
| { files: ["**/*.json5"], plugins: { json }, language: "json/json5", extends: ["json/recommended"] }, | ||
| { files: ["**/*.md"], plugins: { markdown }, language: "markdown/gfm", extends: ["markdown/recommended"] }, | ||
| ]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,210 @@ | ||
| [ | ||
| { | ||
| "message": { | ||
| "epoch": 2, | ||
| "validatorIndex": 0 | ||
| }, | ||
| "signature": { | ||
| "0": 166, | ||
| "1": 226, | ||
| "2": 53, | ||
| "3": 185, | ||
| "4": 29, | ||
| "5": 121, | ||
| "6": 138, | ||
| "7": 61, | ||
| "8": 109, | ||
| "9": 227, | ||
| "10": 218, | ||
| "11": 199, | ||
| "12": 22, | ||
| "13": 145, | ||
| "14": 183, | ||
| "15": 143, | ||
| "16": 222, | ||
| "17": 16, | ||
| "18": 189, | ||
| "19": 146, | ||
| "20": 75, | ||
| "21": 116, | ||
| "22": 43, | ||
| "23": 60, | ||
| "24": 235, | ||
| "25": 188, | ||
| "26": 245, | ||
| "27": 103, | ||
| "28": 195, | ||
| "29": 243, | ||
| "30": 107, | ||
| "31": 32, | ||
| "32": 79, | ||
| "33": 68, | ||
| "34": 200, | ||
| "35": 133, | ||
| "36": 115, | ||
| "37": 71, | ||
| "38": 107, | ||
| "39": 63, | ||
| "40": 138, | ||
| "41": 49, | ||
| "42": 155, | ||
| "43": 77, | ||
| "44": 239, | ||
| "45": 126, | ||
| "46": 16, | ||
| "47": 223, | ||
| "48": 9, | ||
| "49": 50, | ||
| "50": 75, | ||
| "51": 122, | ||
| "52": 117, | ||
| "53": 97, | ||
| "54": 233, | ||
| "55": 84, | ||
| "56": 44, | ||
| "57": 101, | ||
| "58": 251, | ||
| "59": 31, | ||
| "60": 160, | ||
| "61": 138, | ||
| "62": 139, | ||
| "63": 213, | ||
| "64": 202, | ||
| "65": 103, | ||
| "66": 216, | ||
| "67": 21, | ||
| "68": 233, | ||
| "69": 205, | ||
| "70": 122, | ||
| "71": 157, | ||
| "72": 145, | ||
| "73": 199, | ||
| "74": 99, | ||
| "75": 172, | ||
| "76": 249, | ||
| "77": 45, | ||
| "78": 205, | ||
| "79": 140, | ||
| "80": 45, | ||
| "81": 62, | ||
| "82": 248, | ||
| "83": 203, | ||
| "84": 79, | ||
| "85": 162, | ||
| "86": 212, | ||
| "87": 167, | ||
| "88": 166, | ||
| "89": 130, | ||
| "90": 188, | ||
| "91": 133, | ||
| "92": 248, | ||
| "93": 243, | ||
| "94": 172, | ||
| "95": 154 | ||
| } | ||
| }, | ||
| { | ||
| "message": { | ||
| "epoch": 2, | ||
| "validatorIndex": 1 | ||
| }, | ||
| "signature": { | ||
| "0": 130, | ||
| "1": 125, | ||
| "2": 222, | ||
| "3": 60, | ||
| "4": 88, | ||
| "5": 46, | ||
| "6": 123, | ||
| "7": 74, | ||
| "8": 198, | ||
| "9": 139, | ||
| "10": 183, | ||
| "11": 247, | ||
| "12": 163, | ||
| "13": 22, | ||
| "14": 246, | ||
| "15": 45, | ||
| "16": 124, | ||
| "17": 108, | ||
| "18": 253, | ||
| "19": 211, | ||
| "20": 153, | ||
| "21": 185, | ||
| "22": 106, | ||
| "23": 202, | ||
| "24": 230, | ||
| "25": 187, | ||
| "26": 187, | ||
| "27": 3, | ||
| "28": 105, | ||
| "29": 40, | ||
| "30": 153, | ||
| "31": 74, | ||
| "32": 205, | ||
| "33": 50, | ||
| "34": 244, | ||
| "35": 230, | ||
| "36": 94, | ||
| "37": 138, | ||
| "38": 192, | ||
| "39": 151, | ||
| "40": 69, | ||
| "41": 152, | ||
| "42": 142, | ||
| "43": 130, | ||
| "44": 189, | ||
| "45": 235, | ||
| "46": 44, | ||
| "47": 122, | ||
| "48": 5, | ||
| "49": 195, | ||
| "50": 138, | ||
| "51": 234, | ||
| "52": 210, | ||
| "53": 229, | ||
| "54": 84, | ||
| "55": 87, | ||
| "56": 238, | ||
| "57": 141, | ||
| "58": 233, | ||
| "59": 193, | ||
| "60": 213, | ||
| "61": 27, | ||
| "62": 163, | ||
| "63": 66, | ||
| "64": 65, | ||
| "65": 52, | ||
| "66": 163, | ||
| "67": 15, | ||
| "68": 198, | ||
| "69": 151, | ||
| "70": 121, | ||
| "71": 20, | ||
| "72": 215, | ||
| "73": 36, | ||
| "74": 255, | ||
| "75": 97, | ||
| "76": 226, | ||
| "77": 161, | ||
| "78": 222, | ||
| "79": 85, | ||
| "80": 98, | ||
| "81": 238, | ||
| "82": 137, | ||
| "83": 92, | ||
| "84": 242, | ||
| "85": 77, | ||
| "86": 53, | ||
| "87": 247, | ||
| "88": 35, | ||
| "89": 173, | ||
| "90": 210, | ||
| "91": 4, | ||
| "92": 228, | ||
| "93": 73, | ||
| "94": 94, | ||
| "95": 189 | ||
| } | ||
| } | ||
| ] | ||
|
Comment on lines
+1
to
+210
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import tseslint from "typescript-eslint"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are you adding eslint configs? we are use biomejs for linting |
||
|
|
||
| export default tseslint.config([ | ||
| { | ||
| files: ["**/*.ts", "**/*.js"], | ||
| languageOptions: { | ||
| parser: tseslint.parser, | ||
| }, | ||
| plugins: { | ||
| "@typescript-eslint": tseslint.plugin, | ||
| }, | ||
| rules: { | ||
| semi: ["error", "always"], | ||
| quotes: ["error", "double"], | ||
| "@typescript-eslint/no-unused-vars": ["warn"], | ||
| }, | ||
| }, | ||
| ]); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file appears to contain content that should have been in the pull request description. It doesn't seem to be part of the project's documentation and should be removed from the repository.