Skip to content

Commit

Permalink
sort poll by blockNo
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed Oct 13, 2020
1 parent 5c2cef6 commit 161d363
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/balancer/OceanPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ export class OceanPool extends Pool {
fromBlock: 0,
toBlock: 'latest'
})
events.sort((a, b) => (a.blockNumber > b.blockNumber ? 1 : -1))
for (let i = 0; i < events.length; i++) {
const constituents = await super.getCurrentTokens(events[i].returnValues[0])
if (constituents.includes(dtAddress)) result.push(events[i].returnValues[0])
Expand Down

0 comments on commit 161d363

Please sign in to comment.