Handle missing blocks in postgraphile by making RPC call (#296)

This commit is contained in:
2021-12-03 16:23:11 +05:30
committed by GitHub
parent 32fea1f2cb
commit 63ce6fd55f
21 changed files with 94 additions and 76 deletions
@@ -69,7 +69,7 @@ export class Indexer {
this._ethClient = ethClient;
this._postgraphileClient = postgraphileClient;
this._ethProvider = ethProvider;
this._baseIndexer = new BaseIndexer(this._db, this._ethClient, this._ethProvider);
this._baseIndexer = new BaseIndexer(this._db, this._postgraphileClient, this._ethProvider);
const { abi, storageLayout } = artifacts;
@@ -248,8 +248,8 @@ export class Indexer {
return this._baseIndexer.updateSyncStatusCanonicalBlock(blockHash, blockNumber);
}
async getBlock (blockHash: string): Promise<any> {
return this._baseIndexer.getBlock(blockHash);
async getBlocks (blockFilter: { blockNumber?: number, blockHash?: string }): Promise<any> {
return this._baseIndexer.getBlocks(blockFilter);
}
async getEvent (id: string): Promise<Event | undefined> {