mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-07 16:34:06 +00:00
Use prefetching of blocks with events in watchers and codegen (#206)
* Avoid refetching block while fetching events * Prefetch a batch of blocks with events while indexing * Update mock indexer used in graph-node testing * Process available blocks while prefetching * Refactor events fetching to a method in util * Move method to get GQL event query result to util
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import assert from 'assert';
|
||||
import { FindConditions, FindManyOptions } from 'typeorm';
|
||||
import { DeepPartial, FindConditions, FindManyOptions } from 'typeorm';
|
||||
|
||||
import {
|
||||
IndexerInterface,
|
||||
@@ -89,8 +89,8 @@ export class Indexer implements IndexerInterface {
|
||||
return '';
|
||||
}
|
||||
|
||||
async fetchBlockWithEvents (block: BlockProgressInterface): Promise<BlockProgressInterface> {
|
||||
return block;
|
||||
async saveBlockAndFetchEvents (block: BlockProgressInterface): Promise<[BlockProgressInterface, DeepPartial<EventInterface>[]]> {
|
||||
return [block, []];
|
||||
}
|
||||
|
||||
async removeUnknownEvents (block: BlockProgressInterface): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user