Skip to content

Commit

Permalink
handle bigint in json.stringify (#1562)
Browse files Browse the repository at this point in the history
  • Loading branch information
guplersaxanoid authored Mar 14, 2023
1 parent c0fba81 commit 9a65490
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/node-core/src/indexer/smartBatch.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export class SmartBatchService {
}

blockSize(block: any): number {
return Buffer.byteLength(JSON.stringify(block));
return Buffer.byteLength(
JSON.stringify(block, (key, value) => (typeof value === 'bigint' ? value.toString() : value))
);
}

heapMemoryLimit(): number {
Expand Down

0 comments on commit 9a65490

Please sign in to comment.