diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-19 08:44:48 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-12-05 06:24:48 +0800 |
commit | 3a19faa5ff8a66395c5eb8d1400338cefaa21187 (patch) | |
tree | f35c9bbef19ebcef15e92f5f306040727d3b91a4 /packages/pipeline/src/data_sources | |
parent | bbe1a843ef44e518fc957ea36325d5a730502de5 (diff) | |
download | dexon-0x-contracts-3a19faa5ff8a66395c5eb8d1400338cefaa21187.tar dexon-0x-contracts-3a19faa5ff8a66395c5eb8d1400338cefaa21187.tar.gz dexon-0x-contracts-3a19faa5ff8a66395c5eb8d1400338cefaa21187.tar.bz2 dexon-0x-contracts-3a19faa5ff8a66395c5eb8d1400338cefaa21187.tar.lz dexon-0x-contracts-3a19faa5ff8a66395c5eb8d1400338cefaa21187.tar.xz dexon-0x-contracts-3a19faa5ff8a66395c5eb8d1400338cefaa21187.tar.zst dexon-0x-contracts-3a19faa5ff8a66395c5eb8d1400338cefaa21187.zip |
Update script to work with existing v1 pipeline data
Diffstat (limited to 'packages/pipeline/src/data_sources')
-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; |