HarryR / ethsnarks

A toolkit for viable zk-SNARKS on Ethereum, Web, Mobile and Desktop
GNU Lesser General Public License v3.0
240 stars 57 forks source link

fix hashpreimage test error #65

Closed barryWhiteHat closed 5 years ago

barryWhiteHat commented 5 years ago

So there is an error in e/m/hashpreimage.py where it passes bytes instead of string. I added this conversion from string to bytes to convert this. But perhaps you know a better place for this fix to live.

HarryR commented 5 years ago

With Python3 the tests are passing, and I can't replicate this causing problems.

But maybe the same issue is what's happening with the NodeJS FFI integration that's causing the OSX builds to fail?

libc++abi.dylib: terminating with uncaught exception of type boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::property_tree::json_parser::json_parser_error> >: <unspecified file>(9): garbage after data

make: *** [truffle-test] Abort trap: 6

HarryR commented 5 years ago

The error on OSX was due to readFileSync returning a bytes object or something, and the node-ffi wasn't automatically appending a terminating null byte to it.

This is fixed on master.