Skip to content

Commit

Permalink
fix: fetch operators data by blockhash
Browse files Browse the repository at this point in the history
  • Loading branch information
avsetsin committed Apr 16, 2022
1 parent 2763cf8 commit a0f746e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/contracts/registry/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ export class RegistryService implements OnModuleInit {
) {}

@OneAtTime()
public async handleNewBlock({ blockNumber }: BlockData): Promise<void> {
public async handleNewBlock({
blockNumber,
blockHash,
}: BlockData): Promise<void> {
if (blockNumber % REGISTRY_KEYS_CACHE_UPDATE_BLOCK_RATE !== 0) return;
await this.updateNodeOperatorsCache(blockNumber);
await this.updateNodeOperatorsCache({ blockHash });
}

private cachedContract: RegistryAbi | null = null;
Expand Down

0 comments on commit a0f746e

Please sign in to comment.