Skip to content

Commit

Permalink
get_log e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
akonior committed May 29, 2024
1 parent 175afa6 commit 1f7d876
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ethereum/tests/src/get_log.e2e.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { beforeEach, describe, expect, it } from 'vitest';
import { updateNestedField, incHexStr } from 'noir-ethereum-api-oracles';
import { Abi, InputMap, abiEncode } from '@noir-lang/noirc_abi';

import getLogVerifier from '../../contracts/out/GetLogUltraPLONKVerifier.sol/UltraVerifier.json';
import getLog from '../../../target/get_log.json';

import { readProofData } from './proofDataReader.js';
import { FoundryArtefact, deploySolidityProofVerifier } from './solidityVerifier.js';

export const abi = getLog.abi as unknown as Abi;

describe('get_log', async () => {
let proof: Uint8Array;
let inputMap: InputMap;
const proofVerifier = await deploySolidityProofVerifier(getLogVerifier as FoundryArtefact);

beforeEach(async () => {
({ proof, inputMap } = await readProofData('get_log'));
});

it('proof verification succeeds', async () => {
const witnessMap = abiEncode(abi, inputMap, inputMap.return);
expect(await proofVerifier.verify(proof, witnessMap)).toEqual(true);
});
});

0 comments on commit 1f7d876

Please sign in to comment.