From c9e1291860c9788dc6f696be32c3f836ee4e0cfc Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 18 Apr 2024 18:14:32 +0100 Subject: [PATCH] update tests --- .../eth2spec/test/eip7594/unittests/das/test_das.py | 12 ++++++------ .../test_polynomial_commitments.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/das/test_das.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/das/test_das.py index 24011fcdd..1289d61a2 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/das/test_das.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/das/test_das.py @@ -18,11 +18,11 @@ def test_compute_extended_matrix(spec): blob_count = 2 input_blobs = [get_sample_blob(spec, rng=rng) for _ in range(blob_count)] extended_matrix = spec.compute_extended_matrix(input_blobs) - assert len(extended_matrix) == spec.CELLS_PER_BLOB * blob_count + assert len(extended_matrix) == spec.CELLS_PER_EXT_BLOB * blob_count - rows = [extended_matrix[i:(i + spec.CELLS_PER_BLOB)] for i in range(0, len(extended_matrix), spec.CELLS_PER_BLOB)] + rows = [extended_matrix[i:(i + spec.CELLS_PER_EXT_BLOB)] for i in range(0, len(extended_matrix), spec.CELLS_PER_EXT_BLOB)] assert len(rows) == blob_count - assert len(rows[0]) == spec.CELLS_PER_BLOB + assert len(rows[0]) == spec.CELLS_PER_EXT_BLOB for blob_index, row in enumerate(rows): extended_blob = [] @@ -40,7 +40,7 @@ def test_recover_matrix(spec): rng = random.Random(5566) # Number of samples we will be recovering from - N_SAMPLES = spec.CELLS_PER_BLOB // 2 + N_SAMPLES = spec.CELLS_PER_EXT_BLOB // 2 blob_count = 2 cells_dict = {} @@ -54,9 +54,9 @@ def test_recover_matrix(spec): cell_ids = [] # First figure out just the indices of the cells for _ in range(N_SAMPLES): - cell_id = rng.randint(0, spec.CELLS_PER_BLOB - 1) + cell_id = rng.randint(0, spec.CELLS_PER_EXT_BLOB - 1) while cell_id in cell_ids: - cell_id = rng.randint(0, spec.CELLS_PER_BLOB - 1) + cell_id = rng.randint(0, spec.CELLS_PER_EXT_BLOB - 1) cell_ids.append(cell_id) cell = cells[cell_id] cells_dict[(blob_index, cell_id)] = cell diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/polynomial_commitments/test_polynomial_commitments.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/polynomial_commitments/test_polynomial_commitments.py index d49894adb..b6232eaeb 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/polynomial_commitments/test_polynomial_commitments.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/polynomial_commitments/test_polynomial_commitments.py @@ -71,7 +71,7 @@ def test_recover_polynomial(spec): rng = random.Random(5566) # Number of samples we will be recovering from - N_SAMPLES = spec.CELLS_PER_BLOB // 2 + N_SAMPLES = spec.CELLS_PER_EXT_BLOB // 2 # Get the data we will be working with blob = get_sample_blob(spec) @@ -86,9 +86,9 @@ def test_recover_polynomial(spec): cell_ids = [] # First figure out just the indices of the cells for i in range(N_SAMPLES): - j = rng.randint(0, spec.CELLS_PER_BLOB - 1) + j = rng.randint(0, spec.CELLS_PER_EXT_BLOB - 1) while j in cell_ids: - j = rng.randint(0, spec.CELLS_PER_BLOB - 1) + j = rng.randint(0, spec.CELLS_PER_EXT_BLOB - 1) cell_ids.append(j) # Now the cells themselves known_cells_bytes = [cells_bytes[cell_id] for cell_id in cell_ids]