Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getDecoratedOutput and assertOut errors #9

Open
leonvisscher opened this issue Jun 15, 2022 · 4 comments
Open

getDecoratedOutput and assertOut errors #9

leonvisscher opened this issue Jun 15, 2022 · 4 comments

Comments

@leonvisscher
Copy link

I am trying to test my circom circuit but am getting errors.

Generating the witness using let witness = await circuit.calculateWitness({ a: inputA, b: inputB }); works as expected.

Then I am trying these two functions but I get errors:
await circuit.getDecoratedOutput(witness) gives ReferenceError: utils is not defined

and
await circuit.assertOut(witness, expectedOutput) gives AssertionError: Output variable not defined: main[0]

I have no idea what this means and how to fix it. Does someone have any idea?

@Flip-Liquid
Copy link

getting the same issue re: utils not being defined.

it's coming from the following line in the autogenerated /wasm/tester.js file:
if (utils.isDefined(witness[self.symbols[n].varIdx])) {

with utils obviously being undefined.

@Flip-Liquid
Copy link

Flip-Liquid commented Aug 31, 2022

@alrubio, it looks like isDefined isn't itself defined in /wasm/utils.js. and also, the const utils variable defined on line 55 isn't accessible in the scope of getDecoratedOutput.

@mimoo
Copy link

mimoo commented Aug 1, 2023

just modify that line to

if (witness[self.symbols[n].varIdx] !== undefined)

in node_modules/circom_tester/wasm/tester.js

@cre-mer
Copy link

cre-mer commented Aug 1, 2024

Thanks @mimoo, your answer from exactly 1 year ago 🫨 just worked for me. However, I'd really appreciate a proper fix from the contributor here 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants