From 9a65490364cce186d82c05e42f8bdd2f70eb37bc Mon Sep 17 00:00:00 2001 From: Naveen V Date: Wed, 15 Mar 2023 03:41:46 +0800 Subject: [PATCH] handle bigint in json.stringify (#1562) --- packages/node-core/src/indexer/smartBatch.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/node-core/src/indexer/smartBatch.service.ts b/packages/node-core/src/indexer/smartBatch.service.ts index bcd61d6fe2..5decf5ce28 100644 --- a/packages/node-core/src/indexer/smartBatch.service.ts +++ b/packages/node-core/src/indexer/smartBatch.service.ts @@ -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 {