Skip to content

Commit b8c7177

Browse files
fix: remove stale LoggerMiddleware import and restore submitTransaction trackRpc wrapper
1 parent 1a75f6d commit b8c7177

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

backend/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AppModule } from "./app.module";
55
import { HttpExceptionFilter } from "./common/filters/http-exception.filter";
66
import helmet from "helmet";
77
import { ConfigService } from "@nestjs/config";
8-
import { LoggerMiddleware } from "./common/middleware/logger.middleware";
8+
import { RequestContextMiddleware } from "./common/middleware/request-context.middleware";
99
import type { Request, Response, NextFunction } from "express";
1010

1111
export function parseOrigins(raw: string): string[] {

backend/src/rpc/soroban.service.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,24 @@ export class SorobanService {
480480
* Expects base64-encoded XDR (envelope).
481481
*/
482482
async submitTransaction(transactionXdr: string): Promise<SorobanRpc.Api.SendTransactionResponse> {
483-
const server = this.makeServer();
484-
const tx = TransactionBuilder.fromXDR(transactionXdr, this.networkPassphrase);
485-
486-
try {
487-
const response = await server.sendTransaction(tx);
488-
if (response.status === 'ERROR') {
489-
throw new BadRequestException({
490-
code: 'TRANSACTION_REJECTED',
491-
message: 'The transaction was rejected by the network.',
492-
details: response.errorResult,
483+
return this.trackRpc('send_transaction', async () => {
484+
const server = this.makeServer();
485+
const tx = TransactionBuilder.fromXDR(transactionXdr, this.networkPassphrase);
486+
try {
487+
const response = await server.sendTransaction(tx);
488+
if (response.status === 'ERROR') {
489+
throw new BadRequestException({
490+
code: 'TRANSACTION_REJECTED',
491+
message: 'The transaction was rejected by the network.',
492+
details: response.errorResult,
493+
});
494+
}
495+
return response;
496+
} catch (err) {
497+
this.logger.error('Transaction submission error', err);
498+
throw new ServiceUnavailableException({
499+
code: 'SUBMISSION_FAILED',
500+
message: 'Failed to submit transaction to the network.',
493501
});
494502
}
495503
});

0 commit comments

Comments
 (0)