diff --git a/AllTests-mainnet.md b/AllTests-mainnet.md index 1384204e5d..e283cefe9c 100644 --- a/AllTests-mainnet.md +++ b/AllTests-mainnet.md @@ -442,6 +442,17 @@ AllTests-mainnet ``` ## EF - KZG - PeerDAS ```diff ++ KZG - Compute Cells - compute_cells_case_valid_419245fbfe69f145 OK ++ KZG - Compute Cells - compute_cells_case_valid_4aedd1a2a3933c3e OK ++ KZG - Compute Cells - compute_cells_case_valid_6e773f256383918c OK ++ KZG - Compute Cells - compute_cells_case_valid_b0731ef77b166ca8 OK ++ KZG - Compute Cells - compute_cells_case_valid_b81d309b22788820 OK ++ KZG - Compute Cells - compute_cells_case_valid_ed8b5001151417d5 OK ++ KZG - Compute Cells - compute_cells_case_valid_edeb8500a6507818 OK ++ KZG - Compute Cells - compute_cells_invalid_blob_26555bdcbf18a267 OK ++ KZG - Compute Cells - compute_cells_invalid_blob_79fb3cb1ef585a86 OK ++ KZG - Compute Cells - compute_cells_invalid_blob_7e99dea8893c104a OK ++ KZG - Compute Cells - compute_cells_invalid_blob_9d88c33852eb782d OK + KZG - Compute Cells And Proofs - compute_cells_and_kzg_proofs_case_invalid_blob_26555bdcbf OK + KZG - Compute Cells And Proofs - compute_cells_and_kzg_proofs_case_invalid_blob_79fb3cb1ef OK + KZG - Compute Cells And Proofs - compute_cells_and_kzg_proofs_case_invalid_blob_7e99dea889 OK diff --git a/tests/consensus_spec/test_fixture_kzg.nim b/tests/consensus_spec/test_fixture_kzg.nim index ea6bf94008..79bbc8cbf7 100644 --- a/tests/consensus_spec/test_fixture_kzg.nim +++ b/tests/consensus_spec/test_fixture_kzg.nim @@ -201,6 +201,26 @@ proc runComputeBlobKzgProofTest(suiteName, suitePath, path: string) = else: check p.get.bytes == fromHex[48](output.getStr).get +proc runComputeCellsTest(suiteName, suitePath, path: string) = + let relativePathComponent = path.relativeTestPathComponent(suitePath) + test "KZG - Compute Cells - " & relativePathComponent: + let + data = loadToJson(os_ops.readFile(path/"data.yaml"))[0] + output = data["output"] + blob = fromHex[131072](data["input"]["blob"].getStr) + + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-beta.4/tests/formats/kzg_7594/compute_cells.md#condition + if blob.isNone: + check output.kind == JNull + else: + let p = newClone computeCells(KzgBlob(bytes: blob.get)) + if p[].isErr: + check output.kind == JNull + else: + let p_val = p[].get + for i in 0..