Skip to content

Commit a8caf56

Browse files
committed
Fixed generating proof on desktop
1 parent 1d3ca50 commit a8caf56

File tree

1 file changed

+2
-1
lines changed
  • apps/circuit-compiler/src/app/actions

1 file changed

+2
-1
lines changed

apps/circuit-compiler/src/app/actions/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { CircomPluginClient } from "../services/circomPluginClient"
33
import { ActionPayloadTypes, AppState, ICircuitAppContext } from "../types"
44
import { GROTH16_VERIFIER, PLONK_VERIFIER } from './constant'
55
import { extractNameFromKey, extractParentFromKey } from '@remix-ui/helper'
6+
import isElectron from 'is-electron'
67

78
export const compileCircuit = async (plugin: CircomPluginClient, appState: AppState) => {
89
try {
@@ -116,7 +117,7 @@ export const generateProof = async (plugin: CircomPluginClient, appState: AppSta
116117
const r1csBuffer = await plugin.call('fileManager', 'readFile', r1csPath, { encoding: null })
117118
// @ts-ignore
118119
const r1cs = new Uint8Array(r1csBuffer)
119-
const wtnsPath = r1csPath.replace('.r1cs', '.wtn')
120+
const wtnsPath = isElectron() ? extractParentFromKey(appState.filePath) + "/.bin/" + fileName.replace('.circom', '_js') + "/" + fileName.replace('.circom', '.wtn') : r1csPath.replace('.r1cs', '.wtn')
120121
// @ts-ignore
121122
const wtnsBuffer = await plugin.call('fileManager', 'readFile', wtnsPath, { encoding: null })
122123
// @ts-ignore

0 commit comments

Comments
 (0)