Skip to content

Commit

Permalink
maybe correct?
Browse files Browse the repository at this point in the history
  • Loading branch information
martyall committed Oct 7, 2023
1 parent 809763e commit 57c0f92
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Network/Ethereum/Web3/Contract/Events.purs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ filterProducer cs@(MultiFilterStreamState currentState@{ windowSize, currentBloc
nextAvailableBlock = over BlockNumber (_ - fromInt currentState.trailBy) chainHead
in
{ nextEndBlock: min targetEnd nextAvailableBlock, finalBlock: Just targetEnd }
isFinished = maybe false (\final -> currentBlock >= final) finalBlock
isFinished = maybe false (\final -> currentBlock > final) finalBlock
if isFinished then pure cs
else if chainHead < currentBlock then waitForMoreBlocks
else continueTo nextEndBlock
Expand All @@ -210,8 +210,7 @@ filterProducer cs@(MultiFilterStreamState currentState@{ windowSize, currentBloc
modify :: forall (k :: Type) (e :: k). Filter e -> Filter e
modify fltr =
fltr # _fromBlock .~ BN currentBlock
# _toBlock
.~ BN endBlock
# _toBlock .~ BN endBlock

fs' = hmap (ModifyFilter modify) currentFilters
yieldT fs'
Expand Down

0 comments on commit 57c0f92

Please sign in to comment.