This commit is contained in:
Alexey 2019-09-02 17:56:10 +03:00
parent e0ec575745
commit 0e0c87d533

4
cli.js
View File

@ -99,7 +99,7 @@ async function init() {
let contractJson let contractJson
if (inBrowser) { if (inBrowser) {
web3 = new Web3(window.web3.currentProvider, null, { transactionConfirmationBlocks: 1 }) web3 = new Web3(window.web3.currentProvider, null, { transactionConfirmationBlocks: 1 })
contractJson = await (await fetch('build/contracts/Mixer.json')).json() contractJson = await (await fetch('build/contracts/ETHMixer.json')).json()
circuit = await (await fetch('build/circuits/withdraw.json')).json() circuit = await (await fetch('build/circuits/withdraw.json')).json()
proving_key = await (await fetch('build/circuits/withdraw_proving_key.bin')).arrayBuffer() proving_key = await (await fetch('build/circuits/withdraw_proving_key.bin')).arrayBuffer()
MERKLE_TREE_HEIGHT = 16 MERKLE_TREE_HEIGHT = 16
@ -107,7 +107,7 @@ async function init() {
EMPTY_ELEMENT = 0 EMPTY_ELEMENT = 0
} else { } else {
web3 = new Web3('http://localhost:8545', null, { transactionConfirmationBlocks: 1 }) web3 = new Web3('http://localhost:8545', null, { transactionConfirmationBlocks: 1 })
contractJson = require('./build/contracts/Mixer.json') contractJson = require('./build/contracts/ETHMixer.json')
circuit = require('./build/circuits/withdraw.json') circuit = require('./build/circuits/withdraw.json')
proving_key = fs.readFileSync('build/circuits/withdraw_proving_key.bin').buffer proving_key = fs.readFileSync('build/circuits/withdraw_proving_key.bin').buffer
require('dotenv').config() require('dotenv').config()