aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/data_sources/contract-wrappers/exchange_events.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-10-19 08:44:48 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-06 19:04:24 +0800
commit9c35d5369491ae5b62101b680b947e4f6fe64821 (patch)
tree8cfe1819f05d728f840cd32176ef007b39753860 /packages/pipeline/src/data_sources/contract-wrappers/exchange_events.ts
parent8701f9a7b0bdf25e8075db52061df449a0b1a93b (diff)
downloaddexon-0x-contracts-9c35d5369491ae5b62101b680b947e4f6fe64821.tar.gz
dexon-0x-contracts-9c35d5369491ae5b62101b680b947e4f6fe64821.tar.zst
dexon-0x-contracts-9c35d5369491ae5b62101b680b947e4f6fe64821.zip
Update script to work with existing v1 pipeline data
Diffstat (limited to 'packages/pipeline/src/data_sources/contract-wrappers/exchange_events.ts')
-rw-r--r--packages/pipeline/src/data_sources/contract-wrappers/exchange_events.ts5
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;