Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
change howmanyevents
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszradomski committed Feb 8, 2024
1 parent 384572f commit 1e8783f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ describe(DiscoveryProvider.name, () => {
39999,
{
filter: (log) => eventFilter(log),
howManyEvents: 1,
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ export class DiscoveryProvider {
const maxRange = this.getLogsMaxRange
const allLogs: providers.Log[] = []

const howManyEvents =
options.filter !== undefined
? options.howManyEvents ?? 1 // if filtering, assume we only need 1 event
: options.howManyEvents ?? toBlock - fromBlock
const howManyEvents = options.howManyEvents ?? Infinity
const lowerLimitBlock = Math.max(fromBlock, deploymentBlockNumber)
let end = toBlock
do {
Expand Down

0 comments on commit 1e8783f

Please sign in to comment.