Declare global variable

pull/4470/head
ioedeveloper 10 months ago committed by Aniket
parent decb80735f
commit d336b439d9
  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