Port kzg_4844 tests to pytest#4606
Conversation
|
Hmm these templates feel very repetitive. Instead, could we have two templates for each test. A success template and a failure template. Then pass the test name prefix to the template as well? Edit: better yet, a single template for each function which has a |
Here is a list of all the tests templates for ZKG 8488: Which ones in your opinion are testing the same thing? |
|
@leolara I'm saying that in each file, there can be a single template.
Consolidated into a single
I'm just asking for something a bit more generic so we don't have so many template functions. For example: I would like to see it done like this: test_compute_blob_kzg_proof.py |
| y: Bytes32 -- the claimed result of the evaluation | ||
| proof: KZGProof -- The KZG proof | ||
| output: bool -- true (valid proof) or false (incorrect proof) | ||
| output: bool -- true (valid proof) or false (incorrect proof), None if exception is thrown by verify_kzg_proof |
There was a problem hiding this comment.
This is stated at the bottom of each file:
consensus-specs/tests/formats/kzg_4844/verify_kzg_proof.md
Lines 31 to 34 in 048d382
I agree that this could be clearer though. Let's revert this & follow up with another PR that updates this for all KZG formats, instead of just this one.
Also, this can be simplified & we should null instead of None.
true (valid proof), false (incorrect proof), null (error)
kzg_4844 tests to pytest

It does what it says.
Comparing the generated files with
diff -qrproduces:which make sense because that was ported already and it is only in the pytest version.
Note: I have left the non-pytest version commented out so you can check the generated files yourself. I will remove it once it is approved.