-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
55 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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.
Empty file.
Empty file.
30 changes: 30 additions & 0 deletions
30
...pec/eth2spec/test/peerdas/unittests/polynomial_commitments/test_polynomial_commitments.py
This file contains 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,30 @@ | ||
from eth2spec.test.context import ( | ||
spec_test, | ||
single_phase, | ||
with_peerdas_and_later, | ||
) | ||
from eth2spec.test.helpers.sharding import ( | ||
get_sample_blob, | ||
) | ||
|
||
|
||
@with_peerdas_and_later | ||
@spec_test | ||
@single_phase | ||
def test_fft(spec): | ||
vals = [int.from_bytes(x, spec.KZG_ENDIANNESS) for x in spec.KZG_SETUP_G1_MONOMIAL] | ||
roots_of_unity = spec.ROOTS_OF_UNITY | ||
result = spec.fft_field(vals, roots_of_unity) | ||
assert len(result) == len(vals) | ||
# TODO: add more assertions? | ||
|
||
|
||
@with_peerdas_and_later | ||
@spec_test | ||
@single_phase | ||
def test_compute_and_verify_cells_and_proofs(spec): | ||
blob = get_sample_blob(spec) | ||
commitment = spec.blob_to_kzg_commitment(blob) | ||
cells, proofs = spec.compute_cells_and_proofs(blob) | ||
cell_id = 0 | ||
assert spec.verify_cell_proof(commitment, cell_id, cells[cell_id], proofs[cell_id]) |
This file contains 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