Skip to content

Commit

Permalink
Merge pull request #11 from thecotne/fix-eventIndex
Browse files Browse the repository at this point in the history
fix eventIndex
  • Loading branch information
lorcan-codes authored Feb 5, 2024
2 parents 9e87b07 + d9579a4 commit 0d3e9b9
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 0d3e9b9

Please sign in to comment.