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 RPC client interface and updated related components for improved modularity and testability.
### What changed?
- Introduced `IRPCClient` interface in `rpc.go` to abstract RPC client functionality.
- Updated `Client` struct to implement `IRPCClient` interface.
- Modified `Initialize()` function to return `IRPCClient` instead of `*Client`.
- Refactored `Orchestrator`, `ChainTracker`, `Committer`, `FailureRecoverer`, `Poller`, `ReorgHandler`, and `Worker` to use `IRPCClient` interface.
- Moved `GetLatestBlockNumber()` method from `Poller` to `Client`.
- Updated method calls and field accesses throughout the codebase to use the new interface.
### How to test?
1. Ensure indexing works after the refactoring.
### Why make this change?
This refactoring improves the codebase by:
1. Enhancing modularity and separation of concerns.
2. Facilitating easier testing by allowing mock implementations of `IRPCClient`.
3. Improving code maintainability and readability.
4. Providing a clearer contract for RPC client functionality.
5. Enabling easier future extensions or modifications to the RPC client implementation.
0 commit comments