Update codegen templates

This commit is contained in:
Prathamesh Musale 2024-09-16 16:47:16 +05:30
parent 190580f668
commit 85ca9e3efb
3 changed files with 17 additions and 0 deletions

View File

@ -25,6 +25,9 @@
# Flag to specify whether RPC endpoint supports block hash as block tag parameter
rpcSupportsBlockHashParam = true
# Enable ETH JSON RPC server at /rpc
enableEthRPCServer = true
# Server GQL config
[server.gql]
path = "/graphql"

View File

@ -199,6 +199,12 @@ export class Database implements DatabaseInterface {
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber);
}
async getEvents (options: FindManyOptions<Event>): Promise<Array<Event>> {
const repo = this._conn.getRepository(Event);
return this._baseDatabase.getEvents(repo, options);
}
async saveEventEntity (queryRunner: QueryRunner, entity: Event): Promise<Event> {
const repo = queryRunner.manager.getRepository(Event);
return this._baseDatabase.saveEventEntity(repo, entity);

View File

@ -188,6 +188,10 @@ export class Indexer implements IndexerInterface {
return this._storageLayoutMap;
}
get contractMap (): Map<string, ethers.utils.Interface> {
return this._contractMap;
}
{{#if (subgraphPath)}}
get graphWatcher (): GraphWatcher {
return this._graphWatcher;
@ -671,6 +675,10 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
}
async getEvents (options: FindManyOptions<Event>): Promise<Array<Event>> {
return this._db.getEvents(options);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {
return this._baseIndexer.getSyncStatus();
}