Closed weijiekoh closed 5 years ago
Good catch!
Just fixed.
Check v0.0.13
I tried again with this:
template X() {
signal input i;
signal input j;
signal output out;
if (i == 0) {
out <-- i;
}
else {
out <-- j;
}
}
component main = X();
But still received this error.
TypeError: Cannot read property 'neq' of undefined
at execIf (/home/user/circom/src/exec.js:579:18)
at exec (/home/user/circom/src/exec.js:129:16)
at execBlock (/home/user/circom/src/exec.js:225:9)
at instantiateComponent (/home/user/circom/src/exec.js:371:9)
at execInstantiateComponet (/home/user/circom/src/exec.js:330:5)
at execVarAssignement (/home/user/circom/src/exec.js:604:41)
at exec (/home/user/circom/src/exec.js:56:20)
at execBlock (/home/user/circom/src/exec.js:225:9)
at exec (/home/user/circom/src/exec.js:123:16)
at compile (/home/user/circom/src/compiler.js:66:5)
(node:21899) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'nPubInputs' of undefined
at new Circuit (/home/user/circom-experiments/node_modules/snarkjs/src/circuit.js:28:38)
at main (/home/user/circom-experiments/build/test.js:30:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
(node:21899) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:21899) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I'm compiling the circuit not using v0.0.18. Rather, I'm importing the code from commit 9d0b27a7e8ee45308773d6665d874b5d3d6e59cb
.
However, this code works:
template X() {
signal input i;
signal input j;
signal output out;
out <-- i ? j : i;
}
component main = X();
Fixed. Just check version 0.0.19
Be aware also that the above circuit will not generate any constrain. So it will be valid fo any output....
Noted with gratitude. I should use <==
to generate the constraints.
With circom 0.0.12, this circuit works fine:
But this doesn't:
The error message from
circom circuit.circom -o circuit.json
:Another case:
Error message: