Skip to content

Commit b3545a3

Browse files
committed
Remove unused rpc events filter
1 parent 7f8c918 commit b3545a3

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

codegenerator/cli/templates/static/codegen/src/EventFetching.res

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -70,34 +70,6 @@ let makeCombinedEventFilterQuery = (
7070
})
7171
}
7272

73-
let applyConditionalFunction = (value: 'a, condition: bool, callback: 'a => 'b) => {
74-
condition ? callback(value) : value
75-
}
76-
77-
let queryEventsWithCombinedFilter = async (
78-
~contractInterfaceManager,
79-
~fromBlock,
80-
~toBlock,
81-
~minFromBlockLogIndex=0,
82-
~provider,
83-
~logger: Pino.t,
84-
): array<Ethers.log> => {
85-
let combinedFilterRes = await makeCombinedEventFilterQuery(
86-
~provider,
87-
~contractInterfaceManager,
88-
~fromBlock,
89-
~toBlock,
90-
~logger,
91-
)
92-
93-
combinedFilterRes->applyConditionalFunction(minFromBlockLogIndex > 0, arrLogs => {
94-
arrLogs->Belt.Array.keep(log => {
95-
log.blockNumber > fromBlock ||
96-
(log.blockNumber == fromBlock && log.logIndex >= minFromBlockLogIndex)
97-
})
98-
})
99-
}
100-
10173
type eventBatchQuery = {
10274
logs: array<Ethers.log>,
10375
finalExecutedBlockInterval: int,
@@ -108,7 +80,6 @@ let getNextPage = async (
10880
~fromBlock,
10981
~toBlock,
11082
~initialBlockInterval,
111-
~minFromBlockLogIndex=0,
11283
~syncConfig as sc: Config.syncConfig,
11384
~provider,
11485
~logger,
@@ -134,11 +105,10 @@ let getNextPage = async (
134105
let nextToBlock =
135106
Pervasives.min(upperBoundToBlock, toBlock)->Pervasives.max(fromBlockRef.contents) //Defensively ensure we never query a target block below fromBlock
136107
let logsPromise =
137-
queryEventsWithCombinedFilter(
108+
makeCombinedEventFilterQuery(
138109
~contractInterfaceManager,
139110
~fromBlock=fromBlockRef.contents,
140111
~toBlock=nextToBlock,
141-
~minFromBlockLogIndex=fromBlockRef.contents == fromBlock ? minFromBlockLogIndex : 0,
142112
~provider,
143113
~logger,
144114
)->Promise.thenResolve(logs => (logs, nextToBlock - fromBlockRef.contents + 1))

codegenerator/cli/templates/static/codegen/src/eventFetching/chainWorkers/RpcWorker.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ module Make = (
231231
~fromBlock,
232232
~toBlock=targetBlock,
233233
~initialBlockInterval=currentBlockInterval,
234-
~minFromBlockLogIndex=0,
235234
~syncConfig=T.syncConfig,
236235
~provider=T.provider,
237236
~logger,

0 commit comments

Comments
 (0)