OpenZeppelin / OpenZeppelin/Event-Scanner

Update _src/event_scanner/scanner/common.rs_ Function Signatures To Support Mocking Behavior

Open
#241 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: refactor
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.