diff --git a/testing/ef_tests/src/cases/kzg_verify_cell_kzg_proof_batch.rs b/testing/ef_tests/src/cases/kzg_verify_cell_kzg_proof_batch.rs index cc21c6ca7d1..9c651d2d633 100644 --- a/testing/ef_tests/src/cases/kzg_verify_cell_kzg_proof_batch.rs +++ b/testing/ef_tests/src/cases/kzg_verify_cell_kzg_proof_batch.rs @@ -37,37 +37,32 @@ impl Case for KZGVerifyCellKZGProofBatch { fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> { let parse_input = |input: &KZGVerifyCellKZGProofBatchInput| -> Result<_, Error> { let (cells, proofs) = parse_cells_and_proofs(&input.cells, &input.proofs)?; - // TODO: We are not pulling in the latest consensus-specs - // TODO: whereas the kzg libraries are using the new API, so - // TODO: we need to update this code to work for the new API. let row_commitments = input .row_commitments .iter() .map(|s| parse_commitment(s)) .collect::, _>>()?; - // The new API requires the duplicated commitments - let commitments: Vec<_> = input + let coordinates = input .row_indices .iter() - .filter_map(|row_index| row_commitments.get(*row_index).cloned()) - .collect(); - // The new API only requires the cell indices - let cell_indices = input - .column_indices - .iter() - .map(|&col| col as u64) + .zip(&input.column_indices) + .map(|(&row, &col)| (row as u64, col as u64)) .collect::>(); - Ok((cells, proofs, cell_indices, commitments)) + Ok((cells, proofs, coordinates, row_commitments)) }; let result = - parse_input(&self.input).and_then(|(cells, proofs, cell_indices, commitments)| { + parse_input(&self.input).and_then(|(cells, proofs, coordinates, commitments)| { let proofs: Vec = proofs.iter().map(|&proof| proof.into()).collect(); let commitments: Vec = commitments.iter().map(|&c| c.into()).collect(); let cells = cells.iter().map(|c| c.as_ref()).collect::>(); - let kzg = get_kzg(); - match kzg.verify_cell_proof_batch(&cells, &proofs, cell_indices, &commitments) { + let column_indices = coordinates + .into_iter() + .map(|(_row, col)| col) + .collect::>(); + let kzg = get_kzg()?; + match kzg.verify_cell_proof_batch(&cells, &proofs, column_indices, &commitments) { Ok(_) => Ok(true), Err(KzgError::KzgVerificationFailed) => Ok(false), Err(e) => Err(Error::InternalError(format!(