From 1d6b6d90d1833d8dffaf238a475b15bdf83fbfa4 Mon Sep 17 00:00:00 2001 From: GuticaStefan Date: Wed, 8 Jul 2026 13:57:36 +0300 Subject: [PATCH 1/2] remove tx pool shard computation --- src/endpoints/pool/pool.service.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/endpoints/pool/pool.service.ts b/src/endpoints/pool/pool.service.ts index f45ef5957..b95d5cd6d 100644 --- a/src/endpoints/pool/pool.service.ts +++ b/src/endpoints/pool/pool.service.ts @@ -9,8 +9,6 @@ import { TransactionType } from "../transactions/entities/transaction.type"; import { TransactionInPool } from "./entities/transaction.in.pool.dto"; import { PoolFilter } from "./entities/pool.filter"; import { TxInPoolFields } from "src/common/gateway/entities/tx.in.pool.fields"; -import { AddressUtils } from "@multiversx/sdk-nestjs-common"; -import { ProtocolService } from "../../common/protocol/protocol.service"; import { TransactionActionService } from "../transactions/transaction-action/transaction.action.service"; import { Transaction } from "../transactions/entities/transaction"; import { ApiUtils } from "@multiversx/sdk-nestjs-http"; @@ -21,7 +19,6 @@ export class PoolService { private readonly gatewayService: GatewayService, private readonly apiConfigService: ApiConfigService, private readonly cacheService: CacheService, - private readonly protocolService: ProtocolService, private readonly transactionActionService: TransactionActionService, ) { } @@ -96,22 +93,14 @@ export class PoolService { value: tx.value ?? '', gasPrice: tx.gasprice ?? 0, gasLimit: tx.gaslimit ?? 0, + senderShard: tx.sendershard ?? 0, + receiverShard: tx.receivershard ?? 0, data: tx.data ?? '', guardian: tx.guardian ?? '', guardianSignature: tx.guardiansignature ?? '', signature: tx.signature ?? '', type: type ?? TransactionType.Transaction, }); - - // TODO: after gateway's /transaction/pool returns the sendershard and receivershard correctly, remove this computation - const shardCount = await this.protocolService.getShardCount(); - if (transaction.sender) { - transaction.senderShard = AddressUtils.computeShard(AddressUtils.bech32Decode(transaction.sender), shardCount); - } - if (transaction.receiver) { - transaction.receiverShard = AddressUtils.computeShard(AddressUtils.bech32Decode(transaction.receiver), shardCount); - } - const metadata = await this.transactionActionService.getTransactionMetadata(this.poolTransactionToTransaction(transaction), false); if (metadata && metadata.functionName) { transaction.function = metadata.functionName; From 8e38bda99120972c635addb37af199bb54519e24 Mon Sep 17 00:00:00 2001 From: GuticaStefan Date: Wed, 8 Jul 2026 14:15:22 +0300 Subject: [PATCH 2/2] add newline --- src/endpoints/pool/pool.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/endpoints/pool/pool.service.ts b/src/endpoints/pool/pool.service.ts index b95d5cd6d..501261fdf 100644 --- a/src/endpoints/pool/pool.service.ts +++ b/src/endpoints/pool/pool.service.ts @@ -101,6 +101,7 @@ export class PoolService { signature: tx.signature ?? '', type: type ?? TransactionType.Transaction, }); + const metadata = await this.transactionActionService.getTransactionMetadata(this.poolTransactionToTransaction(transaction), false); if (metadata && metadata.functionName) { transaction.function = metadata.functionName;