Fixed event ordering in commitments
This commit is contained in:
parent
9414b751f7
commit
11ee25dbce
@ -170,13 +170,15 @@ export async function getAllCommitments({ fromBlock, toBlock, chainId }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = commitments.map((e) => ({
|
const data = commitments
|
||||||
blockNumber: Number(e.blockNumber),
|
.map((e) => ({
|
||||||
transactionHash: e.transactionHash,
|
blockNumber: Number(e.blockNumber),
|
||||||
index: Number(e.index),
|
transactionHash: e.transactionHash,
|
||||||
commitment: e.commitment,
|
index: Number(e.index),
|
||||||
encryptedOutput: e.encryptedOutput
|
commitment: e.commitment,
|
||||||
}))
|
encryptedOutput: e.encryptedOutput
|
||||||
|
}))
|
||||||
|
.sort((a, b) => a.index - b.index)
|
||||||
|
|
||||||
const [lastEvent] = data.slice(-numbers.ONE)
|
const [lastEvent] = data.slice(-numbers.ONE)
|
||||||
|
|
||||||
|
@ -231,13 +231,15 @@ export async function getAllCommitments({ fromBlock, chainId }: Params) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = commitments.map((e) => ({
|
const data = commitments
|
||||||
index: Number(e.index),
|
.map((e) => ({
|
||||||
commitment: e.commitment,
|
index: Number(e.index),
|
||||||
blockNumber: Number(e.blockNumber),
|
commitment: e.commitment,
|
||||||
encryptedOutput: e.encryptedOutput,
|
blockNumber: Number(e.blockNumber),
|
||||||
transactionHash: e.transactionHash
|
encryptedOutput: e.encryptedOutput,
|
||||||
}))
|
transactionHash: e.transactionHash
|
||||||
|
}))
|
||||||
|
.sort((a, b) => a.index - b.index)
|
||||||
|
|
||||||
const [lastEvent] = data.slice(-numbers.ONE)
|
const [lastEvent] = data.slice(-numbers.ONE)
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user