From 583b90b99fba37f242768c58a729c2c7b9437ce4 Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Fri, 11 Nov 2022 14:46:52 +0530 Subject: [PATCH] Update cerc-io packages version in watcher generation --- .../templates/database-template.handlebars | 2 +- .../src/templates/indexer-template.handlebars | 24 +++++++++---------- .../src/templates/package-template.handlebars | 8 +++---- packages/eden-watcher/src/database.ts | 2 +- packages/graph-test-watcher/src/database.ts | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/codegen/src/templates/database-template.handlebars b/packages/codegen/src/templates/database-template.handlebars index f128f34c8..4d5538ec0 100644 --- a/packages/codegen/src/templates/database-template.handlebars +++ b/packages/codegen/src/templates/database-template.handlebars @@ -37,7 +37,7 @@ export class Database implements DatabaseInterface { } get baseDatabase (): BaseDatabase { - return this.baseDatabase; + return this._baseDatabase; } async init (): Promise { diff --git a/packages/codegen/src/templates/indexer-template.handlebars b/packages/codegen/src/templates/indexer-template.handlebars index e64af650b..c8b70a5ca 100644 --- a/packages/codegen/src/templates/indexer-template.handlebars +++ b/packages/codegen/src/templates/indexer-template.handlebars @@ -564,6 +564,18 @@ export class Indexer implements IndexerInterface { return this._baseIndexer.getAncestorAtDepth(blockHash, depth); } + async resetWatcherToBlock (blockNumber: number): Promise { + const entities = [ + {{#each queries as | query |}} + {{query.entityName}}, + {{/each}} + {{#each subgraphEntities as | subgraphEntity |}} + {{subgraphEntity.className}}, + {{/each}} + ]; + await this._baseIndexer.resetWatcherToBlock(blockNumber, entities); + } + {{#if (subgraphPath)}} getEntityTypesMap (): Map { return this._entityTypesMap; @@ -597,18 +609,6 @@ export class Indexer implements IndexerInterface { this._subgraphStateMap.clear(); } - async resetWatcherToBlock (blockNumber: number): Promise { - const entities = [ - {{#each queries as | query |}} - {{query.entityName}}, - {{/each}} - {{#each subgraphEntities as | subgraphEntity |}} - {{subgraphEntity.className}}, - {{/each}} - ]; - await this._baseIndexer.resetWatcherToBlock(blockNumber, entities); - } - _populateEntityTypesMap (): void { {{#each subgraphEntities as | subgraphEntity |}} this._entityTypesMap.set('{{subgraphEntity.className}}', { diff --git a/packages/codegen/src/templates/package-template.handlebars b/packages/codegen/src/templates/package-template.handlebars index ae80862e0..66e220d6e 100644 --- a/packages/codegen/src/templates/package-template.handlebars +++ b/packages/codegen/src/templates/package-template.handlebars @@ -42,11 +42,11 @@ "@apollo/client": "^3.3.19", "@ethersproject/providers": "^5.4.4", "@ipld/dag-cbor": "^6.0.12", - "@cerc-io/ipld-eth-client": "^0.1.0", - "@cerc-io/solidity-mapper": "^0.1.0", - "@cerc-io/util": "^0.1.0", + "@cerc-io/ipld-eth-client": "^0.2.13", + "@cerc-io/solidity-mapper": "^0.2.13", + "@cerc-io/util": "^0.2.13", {{#if (subgraphPath)}} - "@cerc-io/graph-node": "^0.1.0", + "@cerc-io/graph-node": "^0.2.13", {{/if}} "apollo-server-express": "^2.25.0", "apollo-type-bigint": "^0.1.3", diff --git a/packages/eden-watcher/src/database.ts b/packages/eden-watcher/src/database.ts index 8f5fb0a21..bae3bc5d6 100644 --- a/packages/eden-watcher/src/database.ts +++ b/packages/eden-watcher/src/database.ts @@ -32,7 +32,7 @@ export class Database implements DatabaseInterface { } get baseDatabase (): BaseDatabase { - return this.baseDatabase; + return this._baseDatabase; } async init (): Promise { diff --git a/packages/graph-test-watcher/src/database.ts b/packages/graph-test-watcher/src/database.ts index dd1460631..34cf5ae2a 100644 --- a/packages/graph-test-watcher/src/database.ts +++ b/packages/graph-test-watcher/src/database.ts @@ -37,7 +37,7 @@ export class Database implements DatabaseInterface { } get baseDatabase (): BaseDatabase { - return this.baseDatabase; + return this._baseDatabase; } async init (): Promise {