gnosis / dex-zksnarks

Code to generate snark proofs for batch auction result validation of the Gnosis d.exchange
46 stars 7 forks source link

Do not print last witness twice #20

Closed fleupold closed 5 years ago

fleupold commented 5 years ago

The exported pepper file seems to end with a space and thus we enter the while loop one last time when we have parsed all values but before we reach EOF.

This has lead to printing the last witness variable twice and resulted in one too many variables, causing subsequent solvers to fail.

By peeking into the buffer and checking that the next character is not EOF, we can avoid this.