mirror of
https://github.com/tornadocash/tornado-relayer.git
synced 2025-05-08 17:44:59 -04:00
fix: fee convert to BN
This commit is contained in:
parent
33b6561ffe
commit
0a1b9ab06a
1 changed files with 2 additions and 2 deletions
|
@ -114,7 +114,7 @@ async function checkTornadoFee({ args, contract }) {
|
|||
const ethPrice = await redis.hget('prices', currency)
|
||||
const expense = toBN(toWei(fast.toString(), 'gwei')).mul(toBN(gasLimits[jobType.TORNADO_WITHDRAW]))
|
||||
const feePercent = toBN(fromDecimals(amount, decimals))
|
||||
.mul(toBN(tornadoServiceFee * 1e10))
|
||||
.mul(toBN(parseInt(tornadoServiceFee * 1e10)))
|
||||
.div(toBN(1e10 * 100))
|
||||
let desiredFee
|
||||
switch (currency) {
|
||||
|
@ -159,7 +159,7 @@ async function checkMiningFee({ args }) {
|
|||
? toBN(0)
|
||||
: toBN(args.amount)
|
||||
.sub(providedFee) // args.amount includes fee
|
||||
.mul(toBN(miningServiceFee * 1e10))
|
||||
.mul(toBN(parseInt(miningServiceFee * 1e10)))
|
||||
.div(toBN(1e10 * 100))
|
||||
/* eslint-enable */
|
||||
const desiredFee = expenseInPoints.add(serviceFeePercent) // in points
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue