diff --git a/src/config.ts b/src/config.ts index 1373921..2b344b0 100644 --- a/src/config.ts +++ b/src/config.ts @@ -139,10 +139,10 @@ export const SCRAPER_MODE: ScraperMode = process.env.SCRAPER_MODE === undefined ? DEFAULT_SCRAPER_MODE : process.env.SCRAPER_MODE === 'BLOCKS' - ? 'BLOCKS' - : process.env.SCRAPER_MODE === 'EVENTS' - ? 'EVENTS' - : throwError('Wrong SCRAPER_MODE'); + ? 'BLOCKS' + : process.env.SCRAPER_MODE === 'EVENTS' + ? 'EVENTS' + : throwError('Wrong SCRAPER_MODE'); export const METRICS_PATH = process.env.METRICS_PATH || DEFAULT_METRICS_PATH; export const PROMETHEUS_PORT = getIntConfig('PROMETHEUS_PORT', DEFAULT_PROMETHEUS_PORT); @@ -381,13 +381,13 @@ export const FEAT_UNISWAP_V2_PAIR_CREATED_EVENT = getBoolConfig( export const UNISWAP_V2_PAIR_CREATED_PROTOCOL_CONTRACT_ADDRESSES_AND_START_BLOCKS = process.env .UNISWAP_V2_PAIR_CREATED_PROTOCOL_CONTRACT_ADDRESSES_AND_START_BLOCKS ? process.env.UNISWAP_V2_PAIR_CREATED_PROTOCOL_CONTRACT_ADDRESSES_AND_START_BLOCKS.split(',').map((contract) => { - const [name, factoryAddress, startBlock] = contract.split(':'); - return { - name, - factoryAddress, - startBlock: parseInt(startBlock), - }; - }) + const [name, factoryAddress, startBlock] = contract.split(':'); + return { + name, + factoryAddress, + startBlock: parseInt(startBlock), + }; + }) : []; if ( diff --git a/src/scripts/pull_and_save_block_events.ts b/src/scripts/pull_and_save_block_events.ts index 22e5caf..ea804c4 100644 --- a/src/scripts/pull_and_save_block_events.ts +++ b/src/scripts/pull_and_save_block_events.ts @@ -408,7 +408,9 @@ export class BlockEventsScraper { if (lastKnownBlock === undefined) { logger.warn('First Run'); - const firstStartBlock = Math.min(...eventScrperProps.filter((props) => props.enabled).map((props) => props.startBlock)); + const firstStartBlock = Math.min( + ...eventScrperProps.filter((props) => props.enabled).map((props) => props.startBlock), + ); logger.warn(`Going to start from block: ${firstStartBlock}`); const newBlocks = await web3Source.getBatchBlockInfoForRangeAsync(firstStartBlock, firstStartBlock, true); await getParseSaveBlocksTransactionsEvents(connection, producer, newBlocks, true);