Skip to content

Commit

Permalink
Merge pull request #56 from 0xPolygon/fix-null-recipt-error
Browse files Browse the repository at this point in the history
fix: null recipt error
  • Loading branch information
nitinmittal23 authored Sep 4, 2024
2 parents ca46aee + 39ab847 commit b2be5f8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions internal/block_getters/block_getter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,17 @@ export class BlockGetter extends BlockFormatter implements IBlockGetter {
transactions
);
} catch (error) {
if (errorCount >= this.maxRetries) {
if (errorCount > this.maxRetries) {
Logger.info({
location: "block_getter",
function: "getBlockWithTransactionReceipts",
errorCount,
error: JSON.stringify(error)
});
throw error;
}

return this.getBlockWithTransactionReceipts(blockNumber, errorCount + 1);
return await this.getBlockWithTransactionReceipts(blockNumber, errorCount + 1);
}
}

Expand Down Expand Up @@ -126,11 +132,17 @@ export class BlockGetter extends BlockFormatter implements IBlockGetter {

return this.formatTransactionReceipt(transactionReceipt);
} catch (error) {
if (errorCount >= this.maxRetries) {
if (errorCount > this.maxRetries) {
Logger.info({
location: "block_getter",
function: "getTransactionReceipt",
errorCount,
error: JSON.stringify(error)
});
throw error;
}

return this.getTransactionReceipt(transactionHash, errorCount + 1);
return await this.getTransactionReceipt(transactionHash, errorCount + 1);
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@maticnetwork/chain-indexer-framework",
"version": "1.3.13",
"version": "1.3.14",
"description": "blockchain data indexer",
"type": "module",
"exports": {
Expand Down

0 comments on commit b2be5f8

Please sign in to comment.