diff options
Diffstat (limited to 'packages/pipeline/src/data_sources/contract-wrappers')
-rw-r--r-- | packages/pipeline/src/data_sources/contract-wrappers/exchange_events.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/pipeline/src/data_sources/contract-wrappers/exchange_events.ts b/packages/pipeline/src/data_sources/contract-wrappers/exchange_events.ts index 46f115705..5ce8381cd 100644 --- a/packages/pipeline/src/data_sources/contract-wrappers/exchange_events.ts +++ b/packages/pipeline/src/data_sources/contract-wrappers/exchange_events.ts @@ -29,7 +29,10 @@ export class ExchangeEventsSource { let events: Array<LogWithDecodedArgs<ExchangeFillEventArgs>> = []; for (let currFromBlock = fromBlock; currFromBlock <= calculatedToBlock; currFromBlock += NUM_BLOCKS_PER_QUERY) { events = events.concat( - await this._getFillEventsForRangeAsync(currFromBlock, currFromBlock + NUM_BLOCKS_PER_QUERY - 1), + await this._getFillEventsForRangeAsync( + currFromBlock, + Math.min(currFromBlock + NUM_BLOCKS_PER_QUERY - 1, calculatedToBlock), + ), ); } return events; |