You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
template Foo () {
// signal input y;
signal output x;
x <== 13;
}
template Bar () {
component foo = Foo ();
// foo.y <== 12;
foo.x === 13;
}
component main = Bar ();
It compiles successfully, but what I run snarkjs calculatewitness it reports the following error:
Error: Signal not initialized: main.foo.x
at RTCtx.getSignalFullName (/usr/local/lib/node_modules/snarkjs/src/calculateWitness.js:220:19)
at RTCtx.getPin (/usr/local/lib/node_modules/snarkjs/src/calculateWitness.js:214:21)
at Object.__f [as Bar] (eval at Circuit (/usr/local/lib/node_modules/snarkjs/src/circuit.js:46:33), <anonymous>:2:20)
at RTCtx.triggerComponent (/usr/local/lib/node_modules/snarkjs/src/calculateWitness.js:126:41)
at calculateWitness (/usr/local/lib/node_modules/snarkjs/src/calculateWitness.js:43:45)
at Circuit.calculateWitness (/usr/local/lib/node_modules/snarkjs/src/circuit.js:59:16)
at Object.<anonymous> (/usr/local/lib/node_modules/snarkjs/cli.js:308:29)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
ERROR: Error: Signal not initialized: main.foo.x
I played with this code a bit and it seems that in case template has no inputs, something bad happens with its outputs. Uncommenting commented lines makes it work.
> circom --version
0.0.31
> snarkjs --version
0.1.18
> uname -a
Darwin MacBookPro 19.0.0 Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019; root:xnu-6153.11.26~2/RELEASE_X86_64 x86_64
The text was updated successfully, but these errors were encountered:
3sGgpQ8H
changed the title
Template with no inputs does looses outputs
Template with no inputs looses outputs
Oct 28, 2019
I have the following circuit:
It compiles successfully, but what I run
snarkjs calculatewitness
it reports the following error:I played with this code a bit and it seems that in case template has no inputs, something bad happens with its outputs. Uncommenting commented lines makes it work.
The text was updated successfully, but these errors were encountered: