diff --git a/compiler/integration-tests/test/node/smart_contract_verifier.test.ts b/compiler/integration-tests/test/node/smart_contract_verifier.test.ts index 777ef692876..038c692220f 100644 --- a/compiler/integration-tests/test/node/smart_contract_verifier.test.ts +++ b/compiler/integration-tests/test/node/smart_contract_verifier.test.ts @@ -8,7 +8,6 @@ import toml from 'toml'; import { compile, init_log_level as compilerLogLevel } from '@noir-lang/noir_wasm'; import { Noir } from '@noir-lang/noir_js'; import { BarretenbergBackend } from '@noir-lang/backend_barretenberg'; -import { separatePublicInputsFromProof } from '../shared/proof'; compilerLogLevel('INFO'); @@ -44,19 +43,18 @@ test_cases.forEach((testInfo) => { const prover_toml = readFileSync(resolve(`${base_relative_path}/${test_case}/Prover.toml`)).toString(); const inputs = toml.parse(prover_toml); - const proofWithPublicInputs = await program.generateFinalProof(inputs); + const proofData = await program.generateFinalProof(inputs); // JS verification - const verified = await program.verifyFinalProof(proofWithPublicInputs); + const verified = await program.verifyFinalProof(proofData); expect(verified, 'Proof fails verification in JS').to.be.true; // Smart contract verification const contract = await ethers.deployContract(testInfo.compiled, [], {}); - const { proof, publicInputs } = separatePublicInputsFromProof(proofWithPublicInputs, testInfo.numPublicInputs); - const result = await contract.verify(proof, publicInputs); + const result = await contract.verify(proofData.proof, proofData.publicInputs); expect(result).to.be.true; }); diff --git a/compiler/integration-tests/test/shared/proof.ts b/compiler/integration-tests/test/shared/proof.ts deleted file mode 100644 index e792a8f509e..00000000000 --- a/compiler/integration-tests/test/shared/proof.ts +++ /dev/null @@ -1,17 +0,0 @@ -const FIELD_ELEMENT_BYTES = 32; - -export function separatePublicInputsFromProof( - proof: Uint8Array, - numPublicInputs: number, -): { proof: Uint8Array; publicInputs: Uint8Array[] } { - const publicInputs = Array.from({ length: numPublicInputs }, (_, i) => { - const offset = i * FIELD_ELEMENT_BYTES; - return proof.slice(offset, offset + FIELD_ELEMENT_BYTES); - }); - const slicedProof = proof.slice(numPublicInputs * FIELD_ELEMENT_BYTES); - - return { - proof: slicedProof, - publicInputs, - }; -}