Skip to content

Commit

Permalink
fix: reverted shouldLimit check
Browse files Browse the repository at this point in the history
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
  • Loading branch information
quiet-node committed Jul 19, 2024
1 parent c816a28 commit e79411b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/relay/src/lib/clients/sdkClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,16 @@ export class SDKClient {
const requestIdPrefix = formatRequestIdMessage(requestId);
const currentDateNow = Date.now();
try {
// check hbar limit before executing transaction
if (this.hbarLimiter.shouldLimit(currentDateNow, SDKClient.recordMode, callerName)) {
throw predefined.HBAR_RATE_LIMIT_EXCEEDED;
}

// execute transaction
this.logger.info(`${requestIdPrefix} Execute ${transactionType} transaction`);
const transactionResponse = await transaction.execute(this.clientMain);

// retrieve and capture transaction fee in metrics and rate limiter class
await this.executeGetTransactionRecord(
transactionResponse,
callerName,
Expand Down

0 comments on commit e79411b

Please sign in to comment.