From 4049e0e244a053f9fc7633a175768a3df081d9f4 Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 26 Jan 2024 16:36:19 +0000 Subject: [PATCH] test ordering as it follows in circuit --- .../noir-protocol-circuits/src/index.test.ts | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/yarn-project/noir-protocol-circuits/src/index.test.ts b/yarn-project/noir-protocol-circuits/src/index.test.ts index 8ca3f3e5786..8a3219572d6 100644 --- a/yarn-project/noir-protocol-circuits/src/index.test.ts +++ b/yarn-project/noir-protocol-circuits/src/index.test.ts @@ -27,6 +27,7 @@ import { executeInit, executeInner, executeOrdering } from './index.js'; describe('Private kernel', () => { let logger: DebugLogger; + beforeAll(() => { logger = createDebugLogger('noir-private-kernel'); }); @@ -50,36 +51,36 @@ describe('Private kernel', () => { expect(kernelOutputs).toMatchSnapshot(); }); - // Taken from e2e_nested_contract => performs nested calls => first ordering + // Taken from e2e_nested_contract => performs nested calls => last inner // To regenerate fixture data run the following on the yarn-project/e2e folder // AZTEC_GENERATE_TEST_DATA=1 yarn test e2e_nested_contract -t 'performs nested calls' - it('Executes private kernel ordering after a deployment', async () => { + it('Executes private kernel inner for a nested call', async () => { + logger('Initialized Noir instance with private kernel init circuit'); + const filepath = resolve( dirname(fileURLToPath(import.meta.url)), - './fixtures/nested-call-private-kernel-ordering.hex', + './fixtures/nested-call-private-kernel-inner.hex', ); const serialized = Buffer.from(readFileSync(filepath).toString(), 'hex'); - const kernelInputs = PrivateKernelInputsOrdering.fromBuffer(serialized); + const kernelInputs = PrivateKernelInputsInner.fromBuffer(serialized); - const kernelOutputs = await executeOrdering(kernelInputs); + const kernelOutputs = await executeInner(kernelInputs); expect(kernelOutputs).toMatchSnapshot(); }); - // Taken from e2e_nested_contract => performs nested calls => last inner + // Taken from e2e_nested_contract => performs nested calls => first ordering // To regenerate fixture data run the following on the yarn-project/e2e folder // AZTEC_GENERATE_TEST_DATA=1 yarn test e2e_nested_contract -t 'performs nested calls' - it('Executes private kernel inner for a nested call', async () => { - logger('Initialized Noir instance with private kernel init circuit'); - + it('Executes private kernel ordering after a deployment', async () => { const filepath = resolve( dirname(fileURLToPath(import.meta.url)), - './fixtures/nested-call-private-kernel-inner.hex', + './fixtures/nested-call-private-kernel-ordering.hex', ); const serialized = Buffer.from(readFileSync(filepath).toString(), 'hex'); - const kernelInputs = PrivateKernelInputsInner.fromBuffer(serialized); + const kernelInputs = PrivateKernelInputsOrdering.fromBuffer(serialized); - const kernelOutputs = await executeInner(kernelInputs); + const kernelOutputs = await executeOrdering(kernelInputs); expect(kernelOutputs).toMatchSnapshot(); });