Skip to content

Commit

Permalink
Merge pull request #24 from 0xPolygon/gas-estimate
Browse files Browse the repository at this point in the history
add: comp tx in memory
  • Loading branch information
py-zoid authored Jul 18, 2024
2 parents fab1ebf + 220c814 commit c2f56d5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/services/auto-claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import TransactionService from "./transaction.js";
const _GLOBAL_INDEX_MAINNET_FLAG = BigInt(2 ** 64);

let failedTx: { [key: number]: number } = {};

let completedTx: { [key: string]: boolean } = {};
/**
* AutoClaimService service class is a class which has function to autoclaim transactions
*
Expand Down Expand Up @@ -92,7 +92,8 @@ export default class AutoClaimService {
this.slackNotify &&
failedTx[transaction.counter] &&
(failedTx[transaction.counter] - 1) % 25 === 0 &&
failedTx[transaction.counter] <= 51
failedTx[transaction.counter] <= 51 &&
!completedTx[`${transaction.sourceNetwork}-${transaction.counter}`]
) {
await this.slackNotify.notifyAdminForError({
claimType: transaction.dataType as string,
Expand Down Expand Up @@ -155,6 +156,9 @@ export default class AutoClaimService {
{ gasPrice }
)
response = await this.compressContract.sendCompressedClaims(response)
for (const tx of batch) {
completedTx[`${tx.transaction.sourceNetwork}-${tx.transaction.counter}`] = true
}

Logger.info({
type: 'claimBatch',
Expand Down

0 comments on commit c2f56d5

Please sign in to comment.