Merge pull request #2726 from 0xProject/fix/asset-swapper/rfqtMakerInteraction-with-blacklisting
asset-swapper: isBlacklisted in rfqtMakerInteraction
This commit is contained in:
commit
f7ae697475
@ -334,31 +334,31 @@ export class QuoteRequestor {
|
|||||||
options: RfqtRequestOpts,
|
options: RfqtRequestOpts,
|
||||||
quoteType: 'firm' | 'indicative',
|
quoteType: 'firm' | 'indicative',
|
||||||
): Promise<Array<{ response: ResponseT; makerUri: string }>> {
|
): Promise<Array<{ response: ResponseT; makerUri: string }>> {
|
||||||
|
const requestParamsWithBigNumbers = {
|
||||||
|
takerAddress: options.takerAddress,
|
||||||
|
...inferQueryParams(marketOperation, makerAssetData, takerAssetData, assetFillAmount),
|
||||||
|
};
|
||||||
|
|
||||||
|
// convert BigNumbers to strings
|
||||||
|
// so they are digestible by axios
|
||||||
|
const requestParams = {
|
||||||
|
...requestParamsWithBigNumbers,
|
||||||
|
sellAmountBaseUnits: requestParamsWithBigNumbers.sellAmountBaseUnits
|
||||||
|
? requestParamsWithBigNumbers.sellAmountBaseUnits.toString()
|
||||||
|
: undefined,
|
||||||
|
buyAmountBaseUnits: requestParamsWithBigNumbers.buyAmountBaseUnits
|
||||||
|
? requestParamsWithBigNumbers.buyAmountBaseUnits.toString()
|
||||||
|
: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
const result: Array<{ response: ResponseT; makerUri: string }> = [];
|
const result: Array<{ response: ResponseT; makerUri: string }> = [];
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
Object.keys(this._rfqtAssetOfferings).map(async url => {
|
Object.keys(this._rfqtAssetOfferings).map(async url => {
|
||||||
if (
|
const isBlacklisted = rfqMakerBlacklist.isMakerBlacklisted(url);
|
||||||
this._makerSupportsPair(url, makerAssetData, takerAssetData) &&
|
const partialLogEntry = { url, quoteType, requestParams, isBlacklisted };
|
||||||
!rfqMakerBlacklist.isMakerBlacklisted(url)
|
if (isBlacklisted) {
|
||||||
) {
|
this._infoLogger({ rfqtMakerInteraction: { ...partialLogEntry } });
|
||||||
const requestParamsWithBigNumbers = {
|
} else if (this._makerSupportsPair(url, makerAssetData, takerAssetData)) {
|
||||||
takerAddress: options.takerAddress,
|
|
||||||
...inferQueryParams(marketOperation, makerAssetData, takerAssetData, assetFillAmount),
|
|
||||||
};
|
|
||||||
|
|
||||||
// convert BigNumbers to strings
|
|
||||||
// so they are digestible by axios
|
|
||||||
const requestParams = {
|
|
||||||
...requestParamsWithBigNumbers,
|
|
||||||
sellAmountBaseUnits: requestParamsWithBigNumbers.sellAmountBaseUnits
|
|
||||||
? requestParamsWithBigNumbers.sellAmountBaseUnits.toString()
|
|
||||||
: undefined,
|
|
||||||
buyAmountBaseUnits: requestParamsWithBigNumbers.buyAmountBaseUnits
|
|
||||||
? requestParamsWithBigNumbers.buyAmountBaseUnits.toString()
|
|
||||||
: undefined,
|
|
||||||
};
|
|
||||||
|
|
||||||
const partialLogEntry = { url, quoteType, requestParams };
|
|
||||||
const timeBeforeAwait = Date.now();
|
const timeBeforeAwait = Date.now();
|
||||||
const maxResponseTimeMs =
|
const maxResponseTimeMs =
|
||||||
options.makerEndpointMaxResponseTimeMs === undefined
|
options.makerEndpointMaxResponseTimeMs === undefined
|
||||||
|
Loading…
x
Reference in New Issue
Block a user