diff --git a/assets/services/graph/index.js b/assets/services/graph/index.js index c51e58f..1b52991 100644 --- a/assets/services/graph/index.js +++ b/assets/services/graph/index.js @@ -170,13 +170,15 @@ export async function getAllCommitments({ fromBlock, toBlock, chainId }) { } } - const data = commitments.map((e) => ({ - blockNumber: Number(e.blockNumber), - transactionHash: e.transactionHash, - index: Number(e.index), - commitment: e.commitment, - encryptedOutput: e.encryptedOutput - })) + const data = commitments + .map((e) => ({ + blockNumber: Number(e.blockNumber), + transactionHash: e.transactionHash, + index: Number(e.index), + commitment: e.commitment, + encryptedOutput: e.encryptedOutput + })) + .sort((a, b) => a.index - b.index) const [lastEvent] = data.slice(-numbers.ONE) diff --git a/services/graph/index.ts b/services/graph/index.ts index a60b6de..06e7149 100644 --- a/services/graph/index.ts +++ b/services/graph/index.ts @@ -231,13 +231,15 @@ export async function getAllCommitments({ fromBlock, chainId }: Params) { } } - const data = commitments.map((e) => ({ - index: Number(e.index), - commitment: e.commitment, - blockNumber: Number(e.blockNumber), - encryptedOutput: e.encryptedOutput, - transactionHash: e.transactionHash - })) + const data = commitments + .map((e) => ({ + index: Number(e.index), + commitment: e.commitment, + blockNumber: Number(e.blockNumber), + encryptedOutput: e.encryptedOutput, + transactionHash: e.transactionHash + })) + .sort((a, b) => a.index - b.index) const [lastEvent] = data.slice(-numbers.ONE) diff --git a/static/commitments_100.json.zip b/static/commitments_100.json.zip index 6087c73..956d16d 100644 Binary files a/static/commitments_100.json.zip and b/static/commitments_100.json.zip differ diff --git a/static/nullifiers_100.json.zip b/static/nullifiers_100.json.zip index 9f91687..48e9726 100644 Binary files a/static/nullifiers_100.json.zip and b/static/nullifiers_100.json.zip differ