circomlibjs/test/mimc7contract.js

54 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

// import chai from "chai";
// import {createCode, abi} from "../src/mimc7_gencontract.js";
// import { ethers } from "ethers";
// import ganache from "ganache";
2021-10-30 13:57:29 +02:00
// import buildMimc7 from "../src/mimc7.js";
2021-10-30 13:57:29 +02:00
// const assert = chai.assert;
// const log = (msg) => { if (process.env.MOCHA_VERBOSE) console.log(msg); };
2021-10-30 13:57:29 +02:00
// const SEED = "mimc";
2021-10-30 13:57:29 +02:00
// describe("MiMC Smart contract test", function () {
// let mimc;
// let mimcJS;
// let account;
// this.timeout(100000);
2021-10-30 13:57:29 +02:00
// before(async () => {
// const provider = new ethers.providers.Web3Provider(ganache.provider());
2021-10-30 13:57:29 +02:00
// account = provider.getSigner(0);
// mimcJS = await buildMimc7();
// });
2021-10-30 13:57:29 +02:00
// it("Should deploy the contract", async () => {
2021-10-30 13:57:29 +02:00
// const C = new ethers.ContractFactory(
// abi,
// createCode(SEED, 91),
// account
// );
2021-10-30 13:57:29 +02:00
// mimc = await C.deploy();
// });
2021-10-30 13:57:29 +02:00
// it("Shold calculate the mimc correctly", async () => {
2021-10-30 13:57:29 +02:00
// const res = await mimc["MiMCpe7"](1,2);
2021-10-30 13:57:29 +02:00
// // console.log("Cir: " + bigInt(res.toString(16)).toString(16));
2021-10-30 13:57:29 +02:00
// const res2 = mimcJS.hash(1,2);
// // console.log("Ref: " + bigInt(res2).toString(16));
2021-10-30 13:57:29 +02:00
// assert.equal(res.toString(), mimcJS.F.toString(res2));
2021-10-30 13:57:29 +02:00
// });
2021-10-30 13:57:29 +02:00
// });
2021-10-30 13:57:29 +02:00