Demote instance member to just constructor a arg

Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405963779
This commit is contained in:
F. Eugene Aumson
2020-04-09 12:19:49 -04:00
parent 93872ad7a3
commit 3c795d365d

View File

@@ -38,7 +38,6 @@ export class SwapQuoter {
public readonly chainId: number;
public readonly permittedOrderFeeTypes: Set<OrderPrunerPermittedFeeTypes>;
public readonly rfqtTakerApiKeyWhitelist: string[];
public readonly rfqtMakerEndpoints: string[];
private readonly _contractAddresses: ContractAddresses;
private readonly _protocolFeeUtils: ProtocolFeeUtils;
private readonly _swapQuoteCalculator: SwapQuoteCalculator;
@@ -166,12 +165,12 @@ export class SwapQuoter {
this.expiryBufferMs = expiryBufferMs;
this.permittedOrderFeeTypes = permittedOrderFeeTypes;
this.rfqtTakerApiKeyWhitelist = options.rfqt ? options.rfqt.takerApiKeyWhitelist || [] : [];
this.rfqtMakerEndpoints = options.rfqt ? options.rfqt.makerEndpoints || [] : [];
this._contractAddresses = options.contractAddresses || getContractAddressesForChainOrThrow(chainId);
this._devUtilsContract = new DevUtilsContract(this._contractAddresses.devUtils, provider);
this._protocolFeeUtils = new ProtocolFeeUtils(constants.PROTOCOL_FEE_UTILS_POLLING_INTERVAL_IN_MS);
this._orderStateUtils = new OrderStateUtils(this._devUtilsContract);
this._quoteRequestor = options.quoteRequestor || new QuoteRequestor(this.rfqtMakerEndpoints);
this._quoteRequestor =
options.quoteRequestor || new QuoteRequestor(options.rfqt ? options.rfqt.makerEndpoints || [] : []);
const sampler = new DexOrderSampler(
new IERC20BridgeSamplerContract(this._contractAddresses.erc20BridgeSampler, this.provider, {
gas: samplerGasLimit,