Skip to content

Commit

Permalink
Adds more logging
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
  • Loading branch information
konstantinabl committed Oct 30, 2024
1 parent b84bb7b commit 2158bc7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/relay/src/lib/clients/sdkClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ export class SDKClient {
originalCallerAddress,
currentNetworkExchangeRateInCents,
);
this.logger.info('Created file...');
if (!fileId) {
throw new SDKClientError({}, `${requestDetails.formattedRequestId} No fileId created for transaction. `);
}
Expand All @@ -440,7 +441,7 @@ export class SDKClient {
ethereumTransaction.setMaxTransactionFee(
Hbar.fromTinybars(Math.floor(networkGasPriceInTinyBars * constants.MAX_GAS_PER_SEC)),
);

this.logger.info('About to execute transaction...');
return {
fileId,
txResponse: await this.executeTransaction(
Expand Down Expand Up @@ -709,9 +710,9 @@ export class SDKClient {
try {
this.logger.info(`${requestDetails.formattedRequestId} Execute ${txConstructorName} transaction`);
transactionResponse = await transaction.execute(this.clientMain);

this.logger.info('Transaction Response before receipt', transactionResponse);
transactionId = transactionResponse.transactionId.toString();

this.logger.info('Transaction Id before receipt', transactionId);
// .getReceipt() will throw an error if, in any case, the status !== 22 (SUCCESS).
const transactionReceipt = await transactionResponse.getReceipt(this.clientMain);

Expand Down Expand Up @@ -745,6 +746,7 @@ export class SDKClient {
);

if (!transactionResponse) {
this.logger.info('Transaction Response in if', transactionResponse);

Check warning on line 749 in packages/relay/src/lib/clients/sdkClient.ts

View check run for this annotation

Codecov / codecov/patch

packages/relay/src/lib/clients/sdkClient.ts#L749

Added line #L749 was not covered by tests
throw predefined.INTERNAL_ERROR(
`${requestDetails.formattedRequestId} Transaction execution returns a null value: transactionId=${transaction.transactionId}, callerName=${callerName}, txConstructorName=${txConstructorName}`,
);
Expand Down

0 comments on commit 2158bc7

Please sign in to comment.