From 03e6af5614a8ba0c3f08cb4ac4445e74154c03ad Mon Sep 17 00:00:00 2001 From: Theo Date: Sat, 19 Aug 2023 10:55:41 -0700 Subject: [PATCH] Fix tx object in getGas method & bump version to 0.2.1 --- package.json | 2 +- src/feeOracle.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index abd13e5..aac14f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tornado/tornado-oracles", - "version": "0.2.0", + "version": "0.2.1", "description": "Gas oracle for Tornado-specific transactions", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/src/feeOracle.ts b/src/feeOracle.ts index 55fd9f0..8c08fdc 100644 --- a/src/feeOracle.ts +++ b/src/feeOracle.ts @@ -45,9 +45,9 @@ export abstract class TornadoFeeOracle implements ITornadoFeeOracle { type: TxType = 'other', speed: LegacyGasPriceKey = 'fast', ): Promise { - const gasPrice = await this.getGasPrice(type, speed); + const gasPrice = await this.getGasPriceInHex(type, speed); let gas = BigNumber.from(0); - gas = gas.add(calculateGasPriceInWei(gasPrice)); + gas = gas.add(gasPrice); if (tx) tx = Object.assign(tx, { gasPrice }); gas = gas.mul(await this.getGasLimit(tx, type)); if (this.chainId === ChainId.OPTIMISM) gas = gas.add(await this.fetchL1OptimismFee(tx));