forked from tornadocash/tornado-cli
Fixed token refund calculation when used by wallet directly
This commit is contained in:
parent
336e73dc8d
commit
19ae7d450a
6
dist/cli.js
vendored
6
dist/cli.js
vendored
@ -187136,6 +187136,9 @@ function tornadoProgram() {
|
|||||||
let refund2 = BigInt(0);
|
let refund2 = BigInt(0);
|
||||||
const { url: url2, rewardAccount, tornadoServiceFee } = (relayerClient == null ? void 0 : relayerClient.selectedRelayer) || {};
|
const { url: url2, rewardAccount, tornadoServiceFee } = (relayerClient == null ? void 0 : relayerClient.selectedRelayer) || {};
|
||||||
if (!walletWithdrawal) {
|
if (!walletWithdrawal) {
|
||||||
|
if (!isEth) {
|
||||||
|
refund2 = ethPurchase ? parseEther(`${ethPurchase}`) : tornadoFeeOracle.defaultEthRefund(gasPrice, refundGasLimit);
|
||||||
|
}
|
||||||
fee2 = tornadoFeeOracle.calculateRelayerFee({
|
fee2 = tornadoFeeOracle.calculateRelayerFee({
|
||||||
gasPrice,
|
gasPrice,
|
||||||
gasLimit,
|
gasLimit,
|
||||||
@ -187153,9 +187156,6 @@ function tornadoProgram() {
|
|||||||
throw new Error(errMsg);
|
throw new Error(errMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isEth) {
|
|
||||||
refund2 = ethPurchase ? parseEther(`${ethPurchase}`) : tornadoFeeOracle.defaultEthRefund(gasPrice, refundGasLimit);
|
|
||||||
}
|
|
||||||
const { proof: proof2, args: args2 } = yield calculateSnarkProof(
|
const { proof: proof2, args: args2 } = yield calculateSnarkProof(
|
||||||
{
|
{
|
||||||
root: tree.root,
|
root: tree.root,
|
||||||
|
@ -1001,6 +1001,12 @@ export function tornadoProgram() {
|
|||||||
const { url, rewardAccount, tornadoServiceFee } = relayerClient?.selectedRelayer || {};
|
const { url, rewardAccount, tornadoServiceFee } = relayerClient?.selectedRelayer || {};
|
||||||
|
|
||||||
if (!walletWithdrawal) {
|
if (!walletWithdrawal) {
|
||||||
|
if (!isEth) {
|
||||||
|
refund = ethPurchase
|
||||||
|
? parseEther(`${ethPurchase}`)
|
||||||
|
: tornadoFeeOracle.defaultEthRefund(gasPrice, refundGasLimit);
|
||||||
|
}
|
||||||
|
|
||||||
fee = tornadoFeeOracle.calculateRelayerFee({
|
fee = tornadoFeeOracle.calculateRelayerFee({
|
||||||
gasPrice,
|
gasPrice,
|
||||||
gasLimit,
|
gasLimit,
|
||||||
@ -1023,12 +1029,6 @@ export function tornadoProgram() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isEth) {
|
|
||||||
refund = ethPurchase
|
|
||||||
? parseEther(`${ethPurchase}`)
|
|
||||||
: tornadoFeeOracle.defaultEthRefund(gasPrice, refundGasLimit);
|
|
||||||
}
|
|
||||||
|
|
||||||
const { proof, args } = await calculateSnarkProof(
|
const { proof, args } = await calculateSnarkProof(
|
||||||
{
|
{
|
||||||
root: tree.root,
|
root: tree.root,
|
||||||
|
Loading…
Reference in New Issue
Block a user