You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### TL;DR
Refactored the Poller to separate block polling from data storage operations.
### What changed?
- Split the `Poll` method into two separate methods:
- `PollWithoutSaving`: Handles only the polling of blocks without storing data
- `StageResults`: Handles the storage of polled block data
- Moved the worker results handling logic into these new methods
- Added functionality to track and return the highest block number polled
- Created a helper method `convertPollResultsToBlockData` to transform poll results into block data
### How to test?
1. Run the existing test suite to ensure all functionality works as expected
2. Test the new `PollWithoutSaving` method by calling it directly and verifying it returns the correct block data without saving
3. Test the `StageResults` method by passing block data and verifying it's properly stored
4. Verify that the `Poll` method still returns the highest block number correctly
### Why make this change?
This refactoring improves the separation of concerns in the Poller, making it more flexible by allowing clients to poll blocks without immediately saving the data. This enables more advanced use cases where data processing might be needed before storage, and makes the code more maintainable by breaking down the monolithic polling function into smaller, more focused components.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Refactor**
- Enhanced the polling process to improve data handling and error reporting, resulting in more reliable background operations without affecting user-facing features.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
0 commit comments