Merge remote-tracking branch 'origin/new_proofs' into fusking-truffle

# Conflicts:
#	truffle/migrations/2_deploy_lazy.js
This commit is contained in:
Игорь Соболев 2019-07-01 13:50:43 +03:00
commit db812c1f0c
2 changed files with 13 additions and 20 deletions

View File

@ -2,22 +2,15 @@ var Verifier = artifacts.require('./Verifier.sol');
var VerifierProxy = artifacts.require('./VerifierProxy.sol');
var Lazy = artifacts.require('./Lazy.sol');
const proof1 = [["0x24d858a8ffc1766e7cccf95643f1339cb10978a5b06a6f8abad82782a3ab3efd","0x2d0b5206a856f75a93284728f7cfa61e998868b632b11886a439add8e6150f3e"],[["0x13e6a883986efe7bb0c6e99b00c157d31ea8479283ac6c4934e42368da31e6d8","0x0718d8dfecf7726df8a27092bac85d58767230b33a66dd8c69ca54f576361fc1"],["0x160f03315ee7766d576122244d12bcabd24ee3c7d33e1cb05d838337a0fd0dfb","0x2ea4c7c18ed1b8f3544a4fb3c4d95efa5543182406fef71bfda8760e407a05c7"]],["0x1111708b97dac3f087a3d8e13cfd513d7a82c619d39e9148080b600b7dae210e","0x2a6e76f3003e65afefae71d3fe18ba26a3940e81463bf94615478cdf5daa2249"]];
const input1 = [["0x00000000000000000000000000000000c6481e22c5ff4164af680b8cfaa5e8ed","0x000000000000000000000000000000003120eeff89c4f307c4a6faaae059ce10","0x000000000000000000000000000000005b6d7d198c48c17c9540d29275a04662","0x00000000000000000000000000000000f7a9aa434629a33c84eec3e16e196f27","0x0000000000000000000000000000000000000000000000000000000000000001"]];
module.exports = function(deployer, network, accounts) {
console.log("kuku");
const proof1 = [["0x24d858a8ffc1766e7cccf95643f1339cb10978a5b06a6f8abad82782a3ab3efd", "0x2d0b5206a856f75a93284728f7cfa61e998868b632b11886a439add8e6150f3e"],[["0x13e6a883986efe7bb0c6e99b00c157d31ea8479283ac6c4934e42368da31e6d8", "0x0718d8dfecf7726df8a27092bac85d58767230b33a66dd8c69ca54f576361fc1"], ["0x160f03315ee7766d576122244d12bcabd24ee3c7d33e1cb05d838337a0fd0dfb", "0x2ea4c7c18ed1b8f3544a4fb3c4d95efa5543182406fef71bfda8760e407a05c7"]],["0x1111708b97dac3f087a3d8e13cfd513d7a82c619d39e9148080b600b7dae210e", "0x2a6e76f3003e65afefae71d3fe18ba26a3940e81463bf94615478cdf5daa2249"]]
const input1 = [["0x00000000000000000000000000000000c6481e22c5ff4164af680b8cfaa5e8ed", "0x000000000000000000000000000000003120eeff89c4f307c4a6faaae059ce10", "0x000000000000000000000000000000005b6d7d198c48c17c9540d29275a04662", "0x00000000000000000000000000000000f7a9aa434629a33c84eec3e16e196f27", "0x0000000000000000000000000000000000000000000000000000000000000001"]]
module.exports = async function(deployer, network, accounts) {
deployer.then(async() => {
await deployer.deploy(Verifier);
await deployer.deploy(VerifierProxy, Verifier.address);
console.log(Verifier.address);
var contract = await deployer.deploy(Lazy, VerifierProxy.address);
console.log(VerifierProxy.address);
await contract.submit(input1, proof1);
await contract.submit(input1, proof1);
await contract.submit(input1, proof1);
await contract.submit(input1, proof1);
await contract.submit([[1, 2, 3, 4, 5]], [[1, 2], [[3, 4], [5, 6]], [7, 8]]);
await deployer.deploy(Verifier)
await deployer.deploy(VerifierProxy, Verifier.address)
var contract = await deployer.deploy(Lazy, VerifierProxy.address)
await contract.submit([[1,2,3,4,5]],[[1,2],[[3,4],[5,6]],[7,8]])
await contract.submit(input1,proof1)
})
}

View File

@ -22,17 +22,17 @@ contract("Testing Lazy", accounts => {
});
contract("Testing Verifier", accounts => {
const a = ["0x12d0dbcfc1da3ea29bc017288fceea3929401f4f12dbd0bba73781420d31aa2d", "0x2811c1eaa63f4a804951bd7f994cbb6bea9df64591793b8392400e8756d1bca7"];
const b = [["0x04c33f68e1bd55be0928b086c647debcdf7aa0e3c3efc6a8efbc2596a77a0e67", "0x17e7392e0e3ec2b5701e675e6e0569330d03ffffe476fc8d63cfeaa0ba1c8a97"], ["0x2fc402693a54cd1b176abeed209674f2f12ced1496c6ce27ba8cf16903daa4cc", "0x2c47efba3f4f260da643bb6427d08b551bb3446537d6ac4857d611be2355a446"]];
const c = ["0x04d40f14694092d0f70890a20492b2b68e7eaabdcee744e519678d687c9c3ed0", "0x28de140e393154b0e70b3ef12806af963a4a33b45c24e7864391093b6028fa2b"];
const input = ["0x00000000000000000000000000000000c6481e22c5ff4164af680b8cfaa5e8ed","0x000000000000000000000000000000003120eeff89c4f307c4a6faaae059ce10","0x000000000000000000000000000000005b6d7d198c48c17c9540d29275a04662","0x00000000000000000000000000000000f7a9aa434629a33c84eec3e16e196f27","0x0000000000000000000000000000000000000000000000000000000000000001"]
const input = ["0x00000000000000000000000000000000c6481e22c5ff4164af680b8cfaa5e8ed", "0x000000000000000000000000000000003120eeff89c4f307c4a6faaae059ce10", "0x000000000000000000000000000000005b6d7d198c48c17c9540d29275a04662", "0x00000000000000000000000000000000f7a9aa434629a33c84eec3e16e196f27", "0x0000000000000000000000000000000000000000000000000000000000000001"];
it("should process proofs", async () => {
let instance = await Verifier.deployed();
let result = await instance.verifyTx.call(a,b,c,input);
console.log("verfifier thinks that result is " + result)
// assert.equal(result.valueOf(), false);
});
});