fix test, silence ganache in travis

This commit is contained in:
poma 2019-07-19 15:06:06 +03:00
parent 6443ed8a08
commit 66754181f2
No known key found for this signature in database
GPG Key ID: 530BBEE4AE8C3604
2 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ install:
- cp .env.example .env - cp .env.example .env
- travis_wait 30 npm run build:circuit - travis_wait 30 npm run build:circuit
- npm run build:contract - npm run build:contract
- npx ganache-cli & - npx ganache-cli > /dev/null &
- npm run migrate:dev - npm run migrate:dev
script: script:
- npm run test - npm run test

View File

@ -14,7 +14,7 @@ const { AMOUNT, MERKLE_TREE_HEIGHT, EMPTY_ELEMENT } = process.env
const websnarkUtils = require('websnark/src/utils') const websnarkUtils = require('websnark/src/utils')
const buildGroth16 = require('websnark/src/groth16') const buildGroth16 = require('websnark/src/groth16')
const stringifyBigInts = require('websnark/tools/stringifybigint').stringifyBigInts const stringifyBigInts = require('websnark/tools/stringifybigint').stringifyBigInts
const unstringifyBigInts = require('websnark/tools/stringifybigint').unstringifyBigInts const unstringifyBigInts2 = require('snarkjs/src/stringifybigint').unstringifyBigInts
const snarkjs = require('snarkjs') const snarkjs = require('snarkjs')
const bigInt = snarkjs.bigInt const bigInt = snarkjs.bigInt
const crypto = require('crypto') const crypto = require('crypto')
@ -52,8 +52,8 @@ function getRandomReceiver() {
} }
function snarkVerify(proof) { function snarkVerify(proof) {
proof = unstringifyBigInts(websnarkUtils.fromSolidityInput(proof)) proof = unstringifyBigInts2(websnarkUtils.fromSolidityInput(proof))
const verification_key = unstringifyBigInts(require('../build/circuits/withdraw_verification_key.json')) const verification_key = unstringifyBigInts2(require('../build/circuits/withdraw_verification_key.json'))
return snarkjs['groth'].isValid(verification_key, proof, proof.publicSignals) return snarkjs['groth'].isValid(verification_key, proof, proof.publicSignals)
} }