From a8caf566190d651c7c95ddee4520558f4113209e Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 26 Sep 2024 17:23:02 +0100 Subject: [PATCH] Fixed generating proof on desktop --- apps/circuit-compiler/src/app/actions/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/circuit-compiler/src/app/actions/index.ts b/apps/circuit-compiler/src/app/actions/index.ts index 84417c7feac..20257007d0d 100644 --- a/apps/circuit-compiler/src/app/actions/index.ts +++ b/apps/circuit-compiler/src/app/actions/index.ts @@ -3,6 +3,7 @@ import type { CircomPluginClient } from "../services/circomPluginClient" import { ActionPayloadTypes, AppState, ICircuitAppContext } from "../types" import { GROTH16_VERIFIER, PLONK_VERIFIER } from './constant' import { extractNameFromKey, extractParentFromKey } from '@remix-ui/helper' +import isElectron from 'is-electron' export const compileCircuit = async (plugin: CircomPluginClient, appState: AppState) => { try { @@ -116,7 +117,7 @@ export const generateProof = async (plugin: CircomPluginClient, appState: AppSta const r1csBuffer = await plugin.call('fileManager', 'readFile', r1csPath, { encoding: null }) // @ts-ignore const r1cs = new Uint8Array(r1csBuffer) - const wtnsPath = r1csPath.replace('.r1cs', '.wtn') + const wtnsPath = isElectron() ? extractParentFromKey(appState.filePath) + "/.bin/" + fileName.replace('.circom', '_js') + "/" + fileName.replace('.circom', '.wtn') : r1csPath.replace('.r1cs', '.wtn') // @ts-ignore const wtnsBuffer = await plugin.call('fileManager', 'readFile', wtnsPath, { encoding: null }) // @ts-ignore