fix solidity template dir

This commit is contained in:
Jordi Baylina 2020-07-13 08:54:48 +02:00
parent 8e3316e70c
commit 59d948eb45
No known key found for this signature in database
GPG Key ID: 7480C80C1BE43112
2 changed files with 7 additions and 5 deletions

@ -739,7 +739,7 @@ async function r1csExportJson(r1csFileName, logger) {
var name = "snarkjs"; var name = "snarkjs";
var type = "module"; var type = "module";
var version = "0.3.2"; var version = "0.3.3";
var description = "zkSNARKs implementation in JavaScript"; var description = "zkSNARKs implementation in JavaScript";
var main = "./build/main.cjs"; var main = "./build/main.cjs";
var module$1 = "./main.js"; var module$1 = "./main.js";
@ -6108,9 +6108,10 @@ async function zkeyExportSolidityVerifier(params, options) {
if (options.verbose) Logger.setLogLevel("DEBUG"); if (options.verbose) Logger.setLogLevel("DEBUG");
let templateName; let templateName;
if (path.existsSync(path.join( __dirname, "templates", "verifier_groth16.sol"))) { try {
templateName = path.join( __dirname, "templates", "verifier_groth16.sol"); templateName = path.join( __dirname, "templates", "verifier_groth16.sol");
} else { await fs.promises.stat(templateName);
} catch (err) {
templateName = path.join( __dirname, "..", "templates", "verifier_groth16.sol"); templateName = path.join( __dirname, "..", "templates", "verifier_groth16.sol");
} }

5
cli.js

@ -520,9 +520,10 @@ async function zkeyExportSolidityVerifier(params, options) {
if (options.verbose) Logger.setLogLevel("DEBUG"); if (options.verbose) Logger.setLogLevel("DEBUG");
let templateName; let templateName;
if (path.existsSync(path.join( __dirname, "templates", "verifier_groth16.sol"))) { try {
templateName = path.join( __dirname, "templates", "verifier_groth16.sol"); templateName = path.join( __dirname, "templates", "verifier_groth16.sol");
} else { await fs.promises.stat(templateName);
} catch (err) {
templateName = path.join( __dirname, "..", "templates", "verifier_groth16.sol"); templateName = path.join( __dirname, "..", "templates", "verifier_groth16.sol");
} }