fix template dir
This commit is contained in:
parent
0eac6e98f2
commit
7df37c1592
@ -11,7 +11,6 @@ var readline = _interopDefault(require('readline'));
|
||||
var crypto = _interopDefault(require('crypto'));
|
||||
var circomRuntime = _interopDefault(require('circom_runtime'));
|
||||
var path = _interopDefault(require('path'));
|
||||
var appRoot = _interopDefault(require('app-root-path'));
|
||||
var Logger = _interopDefault(require('logplease'));
|
||||
|
||||
async function open(fileName, openFlags, cacheSize) {
|
||||
@ -740,7 +739,7 @@ async function r1csExportJson(r1csFileName, logger) {
|
||||
|
||||
var name = "snarkjs";
|
||||
var type = "module";
|
||||
var version = "0.3.1";
|
||||
var version = "0.3.2";
|
||||
var description = "zkSNARKs implementation in JavaScript";
|
||||
var main = "./build/main.cjs";
|
||||
var module$1 = "./main.js";
|
||||
@ -777,7 +776,6 @@ var repository = {
|
||||
url: "https://github.com/iden3/snarkjs.git"
|
||||
};
|
||||
var dependencies = {
|
||||
"app-root-path": "^3.0.0",
|
||||
"blake2b-wasm": "https://github.com/jbaylina/blake2b-wasm.git",
|
||||
circom_runtime: "0.0.9",
|
||||
fastfile: "0.0.6",
|
||||
@ -6109,7 +6107,12 @@ async function zkeyExportSolidityVerifier(params, options) {
|
||||
|
||||
if (options.verbose) Logger.setLogLevel("DEBUG");
|
||||
|
||||
const templateName = path.join( appRoot.path, "templates", "verifier_groth16.sol");
|
||||
let templateName;
|
||||
if (path.existsSync(path.join( __dirname, "templates", "verifier_groth16.sol"))) {
|
||||
templateName = path.join( __dirname, "templates", "verifier_groth16.sol");
|
||||
} else {
|
||||
templateName = path.join( __dirname, "..", "templates", "verifier_groth16.sol");
|
||||
}
|
||||
|
||||
const verifierCode = await exportSolidityVerifier(zkeyName, templateName);
|
||||
|
||||
|
8
cli.js
8
cli.js
@ -38,7 +38,6 @@ import * as groth16 from "./src/groth16.js";
|
||||
import * as wtns from "./src/wtns.js";
|
||||
import * as curves from "./src/curves.js";
|
||||
import path from "path";
|
||||
import appRoot from "app-root-path";
|
||||
|
||||
import Logger from "logplease";
|
||||
const logger = Logger.create("snarkJS", {showTimestamp:false});
|
||||
@ -520,7 +519,12 @@ async function zkeyExportSolidityVerifier(params, options) {
|
||||
|
||||
if (options.verbose) Logger.setLogLevel("DEBUG");
|
||||
|
||||
const templateName = path.join( appRoot.path, "templates", "verifier_groth16.sol");
|
||||
let templateName;
|
||||
if (path.existsSync(path.join( __dirname, "templates", "verifier_groth16.sol"))) {
|
||||
templateName = path.join( __dirname, "templates", "verifier_groth16.sol");
|
||||
} else {
|
||||
templateName = path.join( __dirname, "..", "templates", "verifier_groth16.sol");
|
||||
}
|
||||
|
||||
const verifierCode = await zkey.exportSolidityVerifier(zkeyName, templateName, logger);
|
||||
|
||||
|
@ -25,8 +25,6 @@ export default {
|
||||
"keccak",
|
||||
"yargs",
|
||||
"logplease",
|
||||
|
||||
"app-root-path"
|
||||
],
|
||||
plugins: [
|
||||
resolve({
|
||||
|
5
package-lock.json
generated
5
package-lock.json
generated
@ -128,11 +128,6 @@
|
||||
"picomatch": "^2.0.4"
|
||||
}
|
||||
},
|
||||
"app-root-path": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.0.0.tgz",
|
||||
"integrity": "sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw=="
|
||||
},
|
||||
"argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
|
@ -38,7 +38,6 @@
|
||||
"url": "https://github.com/iden3/snarkjs.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"app-root-path": "^3.0.0",
|
||||
"blake2b-wasm": "https://github.com/jbaylina/blake2b-wasm.git",
|
||||
"circom_runtime": "0.0.9",
|
||||
"fastfile": "0.0.6",
|
||||
|
Loading…
Reference in New Issue
Block a user