Skip to content

Commit

Permalink
add blocks counter and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
defi-dev committed Nov 28, 2023
1 parent d17922f commit 5b66fd9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/services/ContractEventsEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,19 @@ export default class ContractEventsEmitter {
this.emitByContractAddress(address, eventName, this.contractByAddress[address].parseLog(l));
});
if (blockNumber && address) {
const diff = this.emitByBlockCount[address][blockNumber] - this.contractEmitterCount[address][blockNumber];
console.log(
blockNumber + ' block logs count(query:',
blockNumber + ' block logs count( query:',
this.emitByBlockCount[address][blockNumber],
'websocket:',
this.contractEmitterCount[address][blockNumber] + ')',
this.contractEmitterCount[address][blockNumber],
')',
);
if (diff != 0) {
console.log(`❗️ ${blockNumber} Block Events Mismatch Error! Diff: ${diff}`);
}
delete this.emitByBlockCount[address][blockNumber];
delete this.contractEmitterCount[address][blockNumber];
}
}

Expand Down

0 comments on commit 5b66fd9

Please sign in to comment.