Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
🐛 Serialize BigInt to base 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersubudhi committed Feb 7, 2024
1 parent f8e9a4e commit b81211f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/export/shared/transactionsExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const logger = Logger();
// Add toJSON to the BigInt and Buffer prototype for error-free serialization
// eslint-disable-next-line no-extend-native
BigInt.prototype.toJSON = function () {
return this.toString(16);
return this.toString(10);
};
Buffer.prototype.toJSON = function () {
return this.toString('hex');
Expand Down Expand Up @@ -339,7 +339,7 @@ const getMessageFeeEntries = async (
const entries = [];

const relayerAmount = BigInt(relayerFeeProcessedEvent.data.relayerAmount);
if (relayerAmount !== BigInt('0')) return entries;
if (relayerAmount === BigInt('0')) return entries;

entries.push({
date: dateFromTimestamp(block.timestamp),
Expand Down

0 comments on commit b81211f

Please sign in to comment.