first integration tests (#64)

resolves #60

Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/64
This commit is contained in:
johba 2025-10-05 19:40:14 +02:00
parent d6f0bf4f02
commit 1645865c5a
14 changed files with 913 additions and 2226 deletions

File diff suppressed because it is too large Load diff

View file

@ -100,6 +100,11 @@ function computeProjections(ringBuffer: bigint[], pointer: number, timestamp: bi
}
export function checkBlockHistorySufficient(context: StatsContext, event: StatsEvent): boolean {
// Guard against incomplete context during initialization
if (!context?.network?.contracts?.Kraiken) {
return false;
}
const currentBlock = event.block.number;
const deployBlock = DEPLOY_BLOCK;
const blocksSinceDeployment = Number(currentBlock - deployBlock);