Merge pull request #2726 from 0xProject/fix/asset-swapper/rfqtMakerInteraction-with-blacklisting

asset-swapper: isBlacklisted in rfqtMakerInteraction
This commit is contained in:
F. Eugene Aumson 2020-10-08 14:19:10 -04:00 committed by GitHub
commit f7ae697475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -334,13 +334,6 @@ export class QuoteRequestor {
options: RfqtRequestOpts,
quoteType: 'firm' | 'indicative',
): Promise<Array<{ response: ResponseT; makerUri: string }>> {
const result: Array<{ response: ResponseT; makerUri: string }> = [];
await Promise.all(
Object.keys(this._rfqtAssetOfferings).map(async url => {
if (
this._makerSupportsPair(url, makerAssetData, takerAssetData) &&
!rfqMakerBlacklist.isMakerBlacklisted(url)
) {
const requestParamsWithBigNumbers = {
takerAddress: options.takerAddress,
...inferQueryParams(marketOperation, makerAssetData, takerAssetData, assetFillAmount),
@ -358,7 +351,14 @@ export class QuoteRequestor {
: undefined,
};
const partialLogEntry = { url, quoteType, requestParams };
const result: Array<{ response: ResponseT; makerUri: string }> = [];
await Promise.all(
Object.keys(this._rfqtAssetOfferings).map(async url => {
const isBlacklisted = rfqMakerBlacklist.isMakerBlacklisted(url);
const partialLogEntry = { url, quoteType, requestParams, isBlacklisted };
if (isBlacklisted) {
this._infoLogger({ rfqtMakerInteraction: { ...partialLogEntry } });
} else if (this._makerSupportsPair(url, makerAssetData, takerAssetData)) {
const timeBeforeAwait = Date.now();
const maxResponseTimeMs =
options.makerEndpointMaxResponseTimeMs === undefined