mirror of
https://github.com/arnaucube/miksi-core.git
synced 2026-02-07 03:26:41 +01:00
Add miksi js lib for build witness calculation
This commit is contained in:
26
test/miksi.test.ts
Normal file
26
test/miksi.test.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
const fs = require("fs");
|
||||
|
||||
const miksi = require("../src/miksi.ts");
|
||||
|
||||
export {};
|
||||
|
||||
describe("deposit test", function () {
|
||||
this.timeout(200000);
|
||||
|
||||
it("Test Deposit", async () => {
|
||||
const secret = "1234567890";
|
||||
const nullifier = "567891234";
|
||||
const commitments = [];
|
||||
|
||||
const wasm = await fs.promises.readFile("./build/deposit.wasm");
|
||||
console.log("w", wasm.length);
|
||||
|
||||
const witness = await miksi.calcWitness(wasm, secret, nullifier, commitments);
|
||||
// console.log("w", witness);
|
||||
|
||||
|
||||
// const pk = await fs.promises.readFile("./build/deposit-proving_key.bin");
|
||||
// const proof = await miksi.calcProof(witness, pk);
|
||||
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user