Skip to content

Commit

Permalink
fix eventIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
thecotne committed Feb 2, 2024
1 parent 9e87b07 commit d9579a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions indexer/src/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ async function pullEvents() {

let blockHash: string | null = null;
let txHash: string | null = null;
let txIndex = 0;
let eventIndex = 0;
let txIndex = -1;
let eventIndex = -1;

for (const emittedEvent of eventsChunk.events.values()) {
if (emittedEvent.block_hash !== blockHash) {
Expand All @@ -148,6 +148,7 @@ async function pullEvents() {
if (emittedEvent.transaction_hash !== txHash) {
txHash = emittedEvent.transaction_hash;
txIndex++;
eventIndex = 0;
} else {
eventIndex++;
}
Expand Down

0 comments on commit d9579a4

Please sign in to comment.