mirror of
https://github.com/vacp2p/zerokit.git
synced 2025-02-20 02:08:13 +00:00
test: add helper function to wrap init
This commit is contained in:
parent
cf7e2de380
commit
936b7fc3cb
@ -1,4 +1,5 @@
|
||||
const fs = require("fs");
|
||||
const rln_wasm = require("/pkg/rln_wasm.js");
|
||||
|
||||
// Utils functions for loading circom witness calculator and reading files from test
|
||||
|
||||
@ -7,8 +8,12 @@ module.exports = {
|
||||
return fs.readFileSync(path);
|
||||
},
|
||||
|
||||
calculateWitness: async function(circom_path, inputs){
|
||||
const wc = require("resources/witness_calculator.js");
|
||||
initWasm: async function() {
|
||||
await rln_wasm();
|
||||
},
|
||||
|
||||
calculateWitness: async function(circom_path, inputs) {
|
||||
const wc = require("/resources/witness_calculator.js");
|
||||
const wasmFile = fs.readFileSync(circom_path);
|
||||
const wasmFileBuffer = wasmFile.slice(wasmFile.byteOffset, wasmFile.byteOffset + wasmFile.byteLength);
|
||||
const witnessCalculator = await wc(wasmFileBuffer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user