Fix hex conversion and rename to cerc-io packages (#178)

* Fix ethersjs hexlify number by removing leading zeros

* Rename to cerc-io packages in codegen templates
This commit is contained in:
nikugogoi 2022-09-09 19:39:52 +05:30 committed by GitHub
parent f3230e3822
commit 996f68a390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import 'reflect-metadata';
import debug from 'debug';
import { Between } from 'typeorm';
import { Database as GraphDatabase, prepareEntityState } from '@vulcanize/graph-node';
import { Database as GraphDatabase, prepareEntityState } from '@cerc-io/graph-node';
import { Indexer } from './indexer';

View File

@ -4,7 +4,7 @@
import debug from 'debug';
import { getConfig } from '@vulcanize/util';
import { getConfig } from '@cerc-io/util';
import { Database } from '../../database';

View File

@ -45,7 +45,7 @@ const cacheBlockSizesAsync = async (provider: providers.JsonRpcProvider, blockNu
// Start prefetching blocks after latest height in blockSizeMap.
for (let i = startBlockHeight; i <= endBlockHeight; i++) {
console.time(`time:misc#cacheBlockSizesAsync-eth_getBlockByNumber-${i}`);
const { size, hash } = await provider.send('eth_getBlockByNumber', [utils.hexlify(i), false]);
const { size, hash } = await provider.send('eth_getBlockByNumber', [utils.hexStripZeros(utils.hexlify(i)), false]);
console.timeEnd(`time:misc#cacheBlockSizesAsync-eth_getBlockByNumber-${i}`);
blockSizeMap.set(hash, { size, blockNumber: i });
}