Fixed nullifier service bug

This commit is contained in:
Tornado Contrib 2024-05-07 12:54:03 +00:00
parent 28a83b6ec4
commit 6447563ea0
Signed by: tornadocontrib
GPG Key ID: 60B4DF1A076C64B1
2 changed files with 16 additions and 18 deletions

@ -140,26 +140,24 @@ const getNullifiers = async (blockFrom) => {
events.push(...graphEvents) events.push(...graphEvents)
blockFrom = lastSyncBlock + numbers.ONE blockFrom = lastSyncBlock + numbers.ONE
} }
let nodeEvents = await self.BatchEventsService.getBatchEvents({
fromBlock: blockFrom,
type: 'NewNullifier'
})
if (!blockTo || blockTo > blockFrom) { if (nodeEvents && nodeEvents.length) {
let nodeEvents = await self.BatchEventsService.getBatchEvents({ nodeEvents = nodeEvents.map(({ blockNumber, transactionHash, args }) => ({
fromBlock: blockFrom, blockNumber,
type: 'NewNullifier' transactionHash,
nullifier: args.nullifier,
}))
console.log({
nodeEvents
}) })
if (nodeEvents && nodeEvents.length) { events.push(...nodeEvents)
nodeEvents = nodeEvents.map(({ blockNumber, transactionHash, args }) => ({
blockNumber,
transactionHash,
nullifier: args.nullifier,
}))
console.log({
nodeEvents
})
events.push(...nodeEvents)
}
} }
return events return events

File diff suppressed because one or more lines are too long