Declare global variable

pull/5370/head
ioedeveloper 10 months ago committed by Aniket
parent 563a2f053a
commit 7c9a9607f7
  1. 14
      apps/circuit-compiler/src/app/components/witness.tsx
  2. 3
      apps/circuit-compiler/src/index.html

@ -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<Record<string, string>>({})
@ -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
}

@ -12,6 +12,9 @@
crossorigin="anonymous" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">
</head>
<body>
<script>
var global = window
</script>
<div id="root"></div>
<script src="snarkjs.min.js"> </script>
<script src="https://kit.fontawesome.com/41dd021e94.js" crossorigin="anonymous"></script>

Loading…
Cancel
Save