diff --git a/src/relayController.js b/src/relayController.js index 27855f9..72e9458 100644 --- a/src/relayController.js +++ b/src/relayController.js @@ -8,7 +8,6 @@ const { web3, fetcher } = require('./instances') async function relay (req, resp) { const { proof, args, contract } = req.body - console.log(proof, args, contract) const gasPrices = fetcher.gasPrices let { valid , reason } = isValidProof(proof) if (!valid) { @@ -37,7 +36,7 @@ async function relay (req, resp) { toBN(args[4]), toBN(args[5]) ] - console.log('root, nullifierHash, recipient, relayer, fee, refund', fee.toString(), refund) + console.log('fee, refund', fee.toString(), refund.toString()) if (currency === 'eth' && !refund.isZero()) { return resp.status(400).json({ error: 'Cannot send refund for eth currency.' }) } diff --git a/src/utils.js b/src/utils.js index f5a2bda..bd9b176 100644 --- a/src/utils.js +++ b/src/utils.js @@ -65,11 +65,14 @@ function isEnoughFee({ gas, gasPrices, currency, refund, ethPrices, fee }) { break } case 'dai': { - desiredFee = expense.add(refund).mul(toBN(ethPrices.dai)).div(toBN(10 ** 18)) + desiredFee = + expense.add(refund) + .mul(toBN(10 ** 18)) + .div(toBN(ethPrices.dai)) break } } - console.log('desired fee', desiredFee) + console.log('desired fee', desiredFee.toString()) if (fee.lt(desiredFee)) { return { isEnough: false, reason: 'Not enough fee' } }