Skip to content

Commit

Permalink
Make method to update state status map synchronous
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamesh0 committed Oct 19, 2022
1 parent 042d616 commit 4baaa81
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/codegen/src/templates/indexer-template.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.watchContract(address, kind, checkpoint, startingBlock);
}

async updateStateStatusMap (address: string, stateStatus: StateStatus): Promise<void> {
await this._baseIndexer.updateStateStatusMap(address, stateStatus);
updateStateStatusMap (address: string, stateStatus: StateStatus): void {
this._baseIndexer.updateStateStatusMap(address, stateStatus);
}

cacheContract (contract: Contract): void {
Expand Down
4 changes: 2 additions & 2 deletions packages/eden-watcher/src/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.watchContract(address, kind, checkpoint, startingBlock);
}

async updateStateStatusMap (address: string, stateStatus: StateStatus): Promise<void> {
await this._baseIndexer.updateStateStatusMap(address, stateStatus);
updateStateStatusMap (address: string, stateStatus: StateStatus): void {
this._baseIndexer.updateStateStatusMap(address, stateStatus);
}

cacheContract (contract: Contract): void {
Expand Down
4 changes: 2 additions & 2 deletions packages/erc20-watcher/src/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.watchContract(address, kind, checkpoint, startingBlock);
}

async updateStateStatusMap (address: string, stateStatus: StateStatus): Promise<void> {
await this._baseIndexer.updateStateStatusMap(address, stateStatus);
updateStateStatusMap (address: string, stateStatus: StateStatus): void {
this._baseIndexer.updateStateStatusMap(address, stateStatus);
}

cacheContract (contract: Contract): void {
Expand Down
4 changes: 2 additions & 2 deletions packages/erc721-watcher/src/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,8 +825,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.watchContract(address, kind, checkpoint, startingBlock);
}

async updateStateStatusMap (address: string, stateStatus: StateStatus): Promise<void> {
await this._baseIndexer.updateStateStatusMap(address, stateStatus);
updateStateStatusMap (address: string, stateStatus: StateStatus): void {
this._baseIndexer.updateStateStatusMap(address, stateStatus);
}

cacheContract (contract: Contract): void {
Expand Down
2 changes: 1 addition & 1 deletion packages/graph-node/test/utils/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class Indexer implements IndexerInterface {
return undefined;
}

async updateStateStatusMap (address: string, stateStatus: StateStatus): Promise<void> {
updateStateStatusMap (address: string, stateStatus: StateStatus): void {
return undefined;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/graph-test-watcher/src/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.watchContract(address, kind, checkpoint, startingBlock);
}

async updateStateStatusMap (address: string, stateStatus: StateStatus): Promise<void> {
await this._baseIndexer.updateStateStatusMap(address, stateStatus);
updateStateStatusMap (address: string, stateStatus: StateStatus): void {
this._baseIndexer.updateStateStatusMap(address, stateStatus);
}

cacheContract (contract: Contract): void {
Expand Down
4 changes: 2 additions & 2 deletions packages/mobymask-watcher/src/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.watchContract(address, kind, checkpoint, startingBlock);
}

async updateStateStatusMap (address: string, stateStatus: StateStatus): Promise<void> {
await this._baseIndexer.updateStateStatusMap(address, stateStatus);
updateStateStatusMap (address: string, stateStatus: StateStatus): void {
this._baseIndexer.updateStateStatusMap(address, stateStatus);
}

cacheContract (contract: Contract): void {
Expand Down
4 changes: 2 additions & 2 deletions packages/util/src/job-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class JobRunner {
break;

case JOB_KIND_CONTRACT:
await this._updateWatchedContracts(job);
this._updateWatchedContracts(job);
break;

default:
Expand Down Expand Up @@ -375,7 +375,7 @@ export class JobRunner {
}
}

async _updateWatchedContracts (job: any): Promise<void> {
_updateWatchedContracts (job: any): void {
const { data: { contract } } = job;

assert(this._indexer.cacheContract);
Expand Down
2 changes: 1 addition & 1 deletion packages/util/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export interface IndexerInterface {
processCheckpoint (blockHash: string): Promise<void>
getStorageValue (storageLayout: StorageLayout, blockHash: string, contractAddress: string, variable: string, ...mappingKeys: MappingKey[]): Promise<ValueResult>
updateSubgraphState?: (contractAddress: string, data: any) => void
updateStateStatusMap (address: string, stateStatus: StateStatus): Promise<void>
updateStateStatusMap (address: string, stateStatus: StateStatus): void
getStateData (state: StateInterface): any
}

Expand Down

0 comments on commit 4baaa81

Please sign in to comment.