mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-11-22 09:47:13 +01:00
fix test, silence ganache in travis
This commit is contained in:
parent
6443ed8a08
commit
66754181f2
@ -7,7 +7,7 @@ install:
|
||||
- cp .env.example .env
|
||||
- travis_wait 30 npm run build:circuit
|
||||
- npm run build:contract
|
||||
- npx ganache-cli &
|
||||
- npx ganache-cli > /dev/null &
|
||||
- npm run migrate:dev
|
||||
script:
|
||||
- npm run test
|
||||
|
@ -14,7 +14,7 @@ const { AMOUNT, MERKLE_TREE_HEIGHT, EMPTY_ELEMENT } = process.env
|
||||
const websnarkUtils = require('websnark/src/utils')
|
||||
const buildGroth16 = require('websnark/src/groth16')
|
||||
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 bigInt = snarkjs.bigInt
|
||||
const crypto = require('crypto')
|
||||
@ -52,8 +52,8 @@ function getRandomReceiver() {
|
||||
}
|
||||
|
||||
function snarkVerify(proof) {
|
||||
proof = unstringifyBigInts(websnarkUtils.fromSolidityInput(proof))
|
||||
const verification_key = unstringifyBigInts(require('../build/circuits/withdraw_verification_key.json'))
|
||||
proof = unstringifyBigInts2(websnarkUtils.fromSolidityInput(proof))
|
||||
const verification_key = unstringifyBigInts2(require('../build/circuits/withdraw_verification_key.json'))
|
||||
return snarkjs['groth'].isValid(verification_key, proof, proof.publicSignals)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user