From 35d4dfb71e160c997c818e5bc03526d6a45ddb44 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 2 Aug 2024 14:11:13 +0100 Subject: [PATCH] Update e2e to test setup GUI --- .../circuit-compiler/src/app/actions/index.ts | 4 ++ .../src/app/components/setupExports.tsx | 7 +-- .../src/app/components/setupExportsBtn.tsx | 1 + apps/remix-ide-e2e/src/tests/circom.test.ts | 45 ++++++++++++++----- 4 files changed, 42 insertions(+), 15 deletions(-) diff --git a/apps/circuit-compiler/src/app/actions/index.ts b/apps/circuit-compiler/src/app/actions/index.ts index 1a59520ea3..a994b18ba1 100644 --- a/apps/circuit-compiler/src/app/actions/index.ts +++ b/apps/circuit-compiler/src/app/actions/index.ts @@ -51,6 +51,8 @@ export const runSetupAndExport = async (plugin: CircomPluginClient, appState: Ap if (appState.exportVerificationKey) { const vKey = await snarkjs.zKey.exportVerificationKey(zkey_final) await plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/groth16/zk/keys/verification_key.json`, JSON.stringify(vKey, null, 2)) + // @ts-ignore + await plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/groth16/zk/keys/zkey_final.txt`, (zkey_final as any).data, { encoding: null }) } if (appState.exportVerificationContract) { const templates = { groth16: GROTH16_VERIFIER } @@ -63,6 +65,8 @@ export const runSetupAndExport = async (plugin: CircomPluginClient, appState: Ap if (appState.exportVerificationKey) { const vKey = await snarkjs.zKey.exportVerificationKey(zkey_final) await plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/plonk/zk/keys/verification_key.json`, JSON.stringify(vKey, null, 2)) + // @ts-ignore + await plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/plonk/zk/keys/zkey_final.txt`, (zkey_final as any).data, { encoding: null }) } if (appState.exportVerificationContract) { const templates = { plonk: PLONK_VERIFIER } diff --git a/apps/circuit-compiler/src/app/components/setupExports.tsx b/apps/circuit-compiler/src/app/components/setupExports.tsx index dc881dfbaa..2116c6a8ec 100644 --- a/apps/circuit-compiler/src/app/components/setupExports.tsx +++ b/apps/circuit-compiler/src/app/components/setupExports.tsx @@ -39,7 +39,7 @@ export function SetupExports () { checked={circuitApp.appState.provingScheme === 'groth16'} readOnly /> -