OpenZeppelin / OpenZeppelin/Event-Scanner
Update _src/event_scanner/scanner/common.rs_ Function Signatures To Support Mocking Behavior
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19
- Forks
- 7
- Avg merge
- 2h 15m
- Merged PRs (30d)
- 4
Description
Two words: Dependency Injection.
Example: instead of relying RobustProvider in the function signature, we could rely on alloy's Provider trait.
This would enable unit testing functions that can currently only be tested with integration tests; some of the flows can't even be tested that way, e.g. reorgs during latest events mode.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/event_scanner/scanner/common.rs, especially the function signature using RobustProvider, and compare it with alloy's Provider trait. Trace the affected scanner flows and determine which signatures must accept the trait so unit tests can cover behavior currently limited to integration tests, including reorgs in latest events mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100