From 92f5b6ae9a9c3d999e696b16140b4be804340908 Mon Sep 17 00:00:00 2001 From: Konstantina Blazhukova Date: Mon, 21 Oct 2024 17:25:50 +0300 Subject: [PATCH] Removes querying to mirrorNode Signed-off-by: Konstantina Blazhukova --- packages/relay/src/lib/clients/sdkClient.ts | 25 +-------------------- 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/packages/relay/src/lib/clients/sdkClient.ts b/packages/relay/src/lib/clients/sdkClient.ts index 7741b5096..8b1fb5cd1 100644 --- a/packages/relay/src/lib/clients/sdkClient.ts +++ b/packages/relay/src/lib/clients/sdkClient.ts @@ -67,9 +67,6 @@ import { ITransactionRecordMetric, RequestDetails, } from '../types'; -import MirrorNode from '@hashgraph/sdk/lib/MirrorNode'; -import { MirrorNodeClient } from './mirrorNodeClient'; -import { Registry } from 'prom-client'; const _ = require('lodash'); @@ -121,8 +118,6 @@ export class SDKClient { */ private readonly eventEmitter: EventEmitter; - private readonly mirrorNodeClient: MirrorNodeClient; - /** * Constructs an instance of the SDKClient and initializes various services and settings. * @@ -139,9 +134,6 @@ export class SDKClient { cacheService: CacheService, eventEmitter: EventEmitter, ) { - const registry = new Registry(); - const restUrl = process.env.MIRROR_NODE_REST_URL || ''; - this.mirrorNodeClient = new MirrorNodeClient(restUrl, logger, registry, cacheService); this.clientMain = clientMain; if (process.env.CONSENSUS_MAX_EXECUTION_TIME) { @@ -757,25 +749,10 @@ export class SDKClient { ); if (!transactionResponse) { - await new Promise((resolve) => setTimeout(resolve, 2000)); - const transactionId = transaction.transactionId ? transaction.transactionId.toString() : false; - console.log('Transaction id', transactionId); - if (transactionId) { - try { - const transactionFromMirrorNode = await this.mirrorNodeClient.getTransactionById( - transactionId, - requestDetails, - ); - this.logger.warn('Transaction found', transactionFromMirrorNode); - } catch (e) { - this.logger.warn('Transaction not found in mirror node', e); - } - } throw predefined.INTERNAL_ERROR( - `${requestDetails.formattedRequestId} TTransaction execution returns a null value: transactionId=${transaction.transactionId}, callerName=${callerName}, txConstructorName=${txConstructorName}`, + `${requestDetails.formattedRequestId} Transaction execution returns a null value: transactionId=${transaction.transactionId}, callerName=${callerName}, txConstructorName=${txConstructorName}`, ); } - return transactionResponse; } finally { if (transactionId?.length) {