external-adapters-js icon indicating copy to clipboard operation
external-adapters-js copied to clipboard

There is a logic missing in adapter cfbenchmarks's endpoint/crypto-lwba.ts.

Open blackbear10000 opened this issue 1 year ago • 0 comments

Description

There is a logic missing in adapter cfbenchmarks's crypto-lwba.ts. When I set API_SECONDARY=false, the code here has no way to generate a proper index to req.requestContext.data.index.

I apologize if my issue may potentially cause inconvenience, as I am not entirely certain if it is the exact problem. Thanks.

export const lwbaReqTransformer = (req: AdapterRequest<typeof inputParameters.validated>): void => {
  additionalInputValidation(req.requestContext.data)

  if (!req.requestContext.data.index) {
    req.requestContext.data.index = getSecondaryId(
      req.requestContext.data.base as string,
      req.requestContext.data.quote as string,
    )
  }

  // Clear base quote to ensure an exact match in the cache with index
  delete req.requestContext.data.base
  delete req.requestContext.data.quote
}

blackbear10000 avatar Aug 28 '23 08:08 blackbear10000