Skip to content

Commit

Permalink
Add to_block param to EventProcessor.process_events
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-stakewise committed Oct 3, 2023
1 parent d09a111 commit d50d70b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sw-utils"
version = "0.3.26"
version = "0.3.27"
description = "StakeWise Python utils"
authors = ["StakeWise Labs <[email protected]>"]
license = "GPL-3.0-or-later"
Expand Down
4 changes: 2 additions & 2 deletions sw_utils/event_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def get_from_block() -> BlockNumber:

@staticmethod
@abstractmethod
async def process_events(events: list[EventData]) -> None:
async def process_events(events: list[EventData], to_block: BlockNumber) -> None:
"""Process incoming events.
This function takes raw events from Web3, transforms them to application's internal
format, then saves it in a database.
Expand Down Expand Up @@ -70,7 +70,7 @@ async def process_new_events(self, to_block: BlockNumber) -> None:
current_to_block, new_events = await self._scan_chunk(
current_from_block, estimated_end_block
)
await self.processor.process_events(new_events)
await self.processor.process_events(new_events, to_block=to_block)

if new_events:
logger.info(
Expand Down

0 comments on commit d50d70b

Please sign in to comment.