diff --git a/package.json b/package.json index 930f3c0..30bb7ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tornado/tornado-oracles", - "version": "1.4.1", + "version": "1.4.2", "description": "Gas oracle for Tornado-specific transactions", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/src/feeOracleV4.ts b/src/feeOracleV4.ts index df21af4..8f51ebd 100644 --- a/src/feeOracleV4.ts +++ b/src/feeOracleV4.ts @@ -26,8 +26,8 @@ export class TornadoFeeOracleV4 extends TornadoFeeOracle implements ITornadoFeeO // For compatibility reasons, when wee check user-provided fee for V4 withdrawal transaction, we need dump gas limit // for about 20 percent,so that the transaction will be sent, even if it results in some loss for the relayer if (type === 'relayer_withdrawal_check_v4') return bump(defaultWithdrawalGasLimit[this.chainId], -25).toNumber(); - if (!tx) return bump(21_000, bumpPercent).toNumber(); + if (!tx || Object.keys(tx).length === 0) return bump(21_000, bumpPercent).toNumber(); - return (await this.provider.estimateGas(tx)).toNumber(); + return bump(await this.provider.estimateGas(tx), bumpPercent).toNumber(); } }