Add public field version to oracle class

This commit is contained in:
Theo 2023-09-06 14:07:35 -07:00
parent 9ef88948d2
commit 394d6cab5c
4 changed files with 4 additions and 3 deletions

@ -1,6 +1,6 @@
{
"name": "@tornado/tornado-oracles",
"version": "3.1.0",
"version": "3.2.0",
"description": "Oracles for Tornado-specific transactions & actions",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",

@ -23,6 +23,7 @@ export abstract class TornadoFeeOracle implements ITornadoFeeOracle {
protected provider: JsonRpcProvider;
public constructor(
public version: 4 | 5,
protected chainId: ChainId,
rpcUrl: string,
protected oracle: GasPriceOracle,

@ -13,7 +13,7 @@ export class TornadoFeeOracleV4 extends TornadoFeeOracle implements ITornadoFeeO
};
const gasPriceOracle = new GasPriceOracle(oracleConfig);
super(chainId, rpcUrl, gasPriceOracle);
super(4, chainId, rpcUrl, gasPriceOracle);
}
async getGasLimit(tx?: TransactionData, type: TxType = 'other', bumpPercent: number = 0): Promise<number> {

@ -26,7 +26,7 @@ export class TornadoFeeOracleV5 extends TornadoFeeOracle implements ITornadoFeeO
};
const gasPriceOracle = new GasPriceOracle(oracleConfig);
super(chainId, rpcUrl, gasPriceOracle);
super(5, chainId, rpcUrl, gasPriceOracle);
this.fallbackFeeOracle = new TornadoFeeOracleV4(chainId, rpcUrl, defaultGasPrices);
}