Mock Engine API req/resp in tests - take 2 #2639
Closed
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.
Replace #2637
It may be better to start with small changes rather than writing overcomplicated scripts.
1. Use validator guide helpers to generate the execution payload for
on_merge_block
testsSee
run_get_execution_payload_with_mock_engine_get_payload
.get_execution_payload
would improve our test coverage a bit. 🙂 We can also create validator guide unit tests later in other PRs.2. Fork choice rule test format updates
This PR changes the existing fork choice tests output:
{'attestation': attestation_0x<attestation_root>}
is now{'on_attestation': {'attestation': 'attestation_0x<attestation_root>'}}
on_block
step.pow_block
outputget_pow_block
helper is called.engine_executePayload
request and response withon_block
on_block
step triggersprocess_execution_payload
andengine_executePayload
:request
fields to verify if the request is as expected.response
fields as the return value of the given APIs.Minor fixes
prepare_payload
parameters in setup.pybuild_empty_execution_payload