From d336b439d9cc764af6a33125f1cdbfea4bc458c3 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 18 Jan 2024 13:07:26 +0100 Subject: [PATCH] Declare global variable --- .../src/app/components/witness.tsx | 14 ++------------ apps/circuit-compiler/src/index.html | 3 +++ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/apps/circuit-compiler/src/app/components/witness.tsx b/apps/circuit-compiler/src/app/components/witness.tsx index 2e43e0c902..3dd794eafb 100644 --- a/apps/circuit-compiler/src/app/components/witness.tsx +++ b/apps/circuit-compiler/src/app/components/witness.tsx @@ -4,6 +4,7 @@ import { CompilerStatus } from "../types"; import { computeWitness } from "../actions"; import { useState } from "react"; import type { CircomPluginClient } from "../services/circomPluginClient"; +import * as remixLib from '@remix-project/remix-lib' export function WitnessSection ({ plugin, signalInputs, status }: {plugin: CircomPluginClient, signalInputs: string[], status: CompilerStatus}) { const [witnessValues, setWitnessValues] = useState>({}) @@ -12,18 +13,7 @@ export function WitnessSection ({ plugin, signalInputs, status }: {plugin: Circo let value = e.target.value try { - value = JSON.parse(JSON.stringify(value, (key, value) => { - if (typeof value === 'bigint') { - return value.toString() - } else { - try { - const parsedValue = JSON.parse(value) - - return Array.isArray(parsedValue) ? parsedValue : value - } catch (e) { - return value - } - }})) + value = remixLib.execution.txFormat.parseFunctionParams(value) } catch (e) { // do nothing } diff --git a/apps/circuit-compiler/src/index.html b/apps/circuit-compiler/src/index.html index 9ce64d34c3..960fac503a 100644 --- a/apps/circuit-compiler/src/index.html +++ b/apps/circuit-compiler/src/index.html @@ -12,6 +12,9 @@ crossorigin="anonymous" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"> +