From 55bd8cbc4c6403cfa17a7f756409aa51689307b7 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 27 Aug 2024 16:40:57 +0100 Subject: [PATCH] Track json export of witness --- apps/circuit-compiler/src/app/actions/index.ts | 1 + apps/circuit-compiler/src/app/services/circomPluginClient.ts | 2 +- 2 files 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 3ea38a92da..84417c7fea 100644 --- a/apps/circuit-compiler/src/app/actions/index.ts +++ b/apps/circuit-compiler/src/app/actions/index.ts @@ -31,6 +31,7 @@ export const computeWitness = async (plugin: CircomPluginClient, appState: AppSt const writePath = extractParentFromKey(appState.filePath) + `/.bin/${fileName.replace('.circom', '.wtn.json')}` await plugin.call('fileManager', 'writeFile', writePath, JSON.stringify(wtnsJson, null, 2)) + plugin._paq.push(['trackEvent', 'circuit-compiler', 'computeWitness', 'wtns.exportJson', writePath]) } } else { console.log('Existing witness computation in progress') diff --git a/apps/circuit-compiler/src/app/services/circomPluginClient.ts b/apps/circuit-compiler/src/app/services/circomPluginClient.ts index 95c764f99d..15bfa518a0 100644 --- a/apps/circuit-compiler/src/app/services/circomPluginClient.ts +++ b/apps/circuit-compiler/src/app/services/circomPluginClient.ts @@ -249,7 +249,7 @@ export class CircomPluginClient extends PluginClient { const witness = this.compiler ? await this.compiler.generate_witness(dataRead, input) : await generate_witness(dataRead, input) // @ts-ignore await this.call('fileManager', 'writeFile', wasmPath.replace('.wasm', '.wtn'), witness, true) - this._paq.push(['trackEvent', 'circuit-compiler', 'computeWitness', 'Witness computing successful']) + this._paq.push(['trackEvent', 'circuit-compiler', 'computeWitness', 'compiler.generate_witness', wasmPath.replace('.wasm', '.wtn')]) this.internalEvents.emit('circuit_computing_witness_done') this.emit('statusChanged', { key: 'succeed', title: 'witness computed successfully', type: 'success' }) return witness