Skip to content

Commit

Permalink
revert me
Browse files Browse the repository at this point in the history
Signed-off-by: Logan Nguyen <[email protected]>
  • Loading branch information
quiet-node committed Dec 22, 2024
1 parent 7b1c987 commit aad493c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions packages/relay/src/lib/clients/mirrorNodeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -770,26 +770,26 @@ export class MirrorNodeClient {
): Promise<any> {
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(

Check warning on line 783 in packages/relay/src/lib/clients/mirrorNodeClient.ts

View check run for this annotation

Codecov / codecov/patch

packages/relay/src/lib/clients/mirrorNodeClient.ts#L783

Added line #L783 was not covered by tests
`${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;
}

Expand Down

0 comments on commit aad493c

Please sign in to comment.