Skip to content

Commit cc324b3

Browse files
thecotnegharbi-bdr
authored andcommitted
fix eventIndex
1 parent f8cfd8a commit cc324b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

indexer/src/indexer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ async function pullEvents() {
135135

136136
let blockHash: string | null = null;
137137
let txHash: string | null = null;
138-
let txIndex = 0;
139-
let eventIndex = 0;
138+
let txIndex = -1;
139+
let eventIndex = -1;
140140

141141
for (const emittedEvent of eventsChunk.events.values()) {
142142
if (emittedEvent.block_hash !== blockHash) {
@@ -148,6 +148,7 @@ async function pullEvents() {
148148
if (emittedEvent.transaction_hash !== txHash) {
149149
txHash = emittedEvent.transaction_hash;
150150
txIndex++;
151+
eventIndex = 0;
151152
} else {
152153
eventIndex++;
153154
}

0 commit comments

Comments
 (0)