From aad493cc474d80ce9b5a67ed613b24c9afefb299 Mon Sep 17 00:00:00 2001 From: Logan Nguyen Date: Sun, 22 Dec 2024 13:39:19 -0600 Subject: [PATCH] revert me Signed-off-by: Logan Nguyen --- .../relay/src/lib/clients/mirrorNodeClient.ts | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/relay/src/lib/clients/mirrorNodeClient.ts b/packages/relay/src/lib/clients/mirrorNodeClient.ts index 63ac207c6d..db5ad1c99f 100644 --- a/packages/relay/src/lib/clients/mirrorNodeClient.ts +++ b/packages/relay/src/lib/clients/mirrorNodeClient.ts @@ -770,26 +770,26 @@ export class MirrorNodeClient { ): Promise { const shortDelay = 500; const contractResult = await this[methodName](...args); - const contractObjects = Array.isArray(contractResult) ? contractResult : [contractResult]; - - for (const contractObject of contractObjects) { - if ( - contractObject && - (contractObject.transaction_index == null || - contractObject.block_number == null || - contractObject.block_hash == EthImpl.emptyHex) - ) { - if (this.logger.isLevelEnabled('debug')) { - this.logger.debug( - `${requestDetails.formattedRequestId} Contract result contains undefined transaction_index, block_number, or block_hash set to 0x: transaction_hash:${contractObject.hash}, transaction_index:${contractObject.transaction_index}, block_number=${contractObject.block_number}, block_hash=${contractObject.block_hash}. Retrying after a delay of ${shortDelay} ms `, - ); - } + // const contractObjects = Array.isArray(contractResult) ? contractResult : [contractResult]; - // Backoff before repeating request - await new Promise((r) => setTimeout(r, shortDelay)); - return await this[methodName](...args); + // for (const contractObject of contractObjects) { + if ( + contractResult && + (contractResult.transaction_index == null || + contractResult.block_number == null || + contractResult.block_hash == EthImpl.emptyHex) + ) { + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `${requestDetails.formattedRequestId} Contract result contains undefined transaction_index, block_number, or block_hash set to 0x: transaction_hash:${contractResult.hash}, transaction_index:${contractResult.transaction_index}, block_number=${contractResult.block_number}, block_hash=${contractResult.block_hash}. Retrying after a delay of ${shortDelay} ms `, + ); } + + // Backoff before repeating request + await new Promise((r) => setTimeout(r, shortDelay)); + return await this[methodName](...args); } + // } return contractResult; }