The account processor's filter logic in account.rs lacks comprehensive unit tests, making it difficult to verify its correctness for various filter configurations.
Problem
The process_account_update function contains filter logic with multiple paths based on account selection criteria. However:
- These different paths and edge cases are not fully covered by unit tests.
- Changes to the filtering logic risk breaking functionality without proper test coverage.
Required Changes
-
Create unit tests in crates/windexer-geyser/src/processor/account.rs to cover:
- Wildcard filters (
"*")
- Specific account filters
- Owner filters
- Combinations of account and owner filters
- Edge cases, such as:
- Empty filters
- Invalid accounts
-
Documentation:
- Add comments for each test case explaining what it is testing and why.
Implementation Hints
- Use the Rust
#[test] attribute to define unit tests.
- Mock any required dependencies or inputs for the
process_account_update function.
- Example test structure:
#[test]
fn test_wildcard_filter() {
let result = process_account_update("*", /* other params */);
assert!(result.is_ok());
// Add additional assertions for expected behavior
}
- Write separate tests for each filter type and edge case.
Acceptance Criteria
The account processor's filter logic in
account.rslacks comprehensive unit tests, making it difficult to verify its correctness for various filter configurations.Problem
The
process_account_updatefunction contains filter logic with multiple paths based on account selection criteria. However:Required Changes
Create unit tests in
crates/windexer-geyser/src/processor/account.rsto cover:"*")Documentation:
Implementation Hints
#[test]attribute to define unit tests.process_account_updatefunction.Acceptance Criteria
*, specific accounts, owners, combinations).