test(api): add API endpoint response conformance test vectors#617
Open
tcoratger wants to merge 1 commit intoleanEthereum:mainfrom
Open
test(api): add API endpoint response conformance test vectors#617tcoratger wants to merge 1 commit intoleanEthereum:mainfrom
tcoratger wants to merge 1 commit intoleanEthereum:mainfrom
Conversation
Introduces an ApiEndpointTest fixture that generates JSON test vectors for the 4 deterministic API endpoints. Given genesis parameters, the fixture builds a store and computes the exact expected HTTP response (status code, content type, body) for each endpoint. Endpoints covered: - GET /lean/v0/health (static JSON payload) - GET /lean/v0/checkpoints/justified (slot + root from store) - GET /lean/v0/states/finalized (hex-encoded SSZ bytes) - GET /lean/v0/fork_choice (full tree with weights and checkpoints) 6 test vectors with two genesis configurations (4 and 12 validators) to verify that different validator counts produce different roots. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Endpoints covered
Vectors (6 total)
Test plan
uvx tox -e all-checkspassesuv run fill --fork=devnet --clean -n auto -- tests/consensus/devnet/api/generates all 6 fixtures{"status": "healthy", "service": "lean-rpc-api"}🤖 Generated with Claude Code