Skip to content

reader::get_liquidatable_positions and get_pending_orders (keeper bulk-scan queries) have zero test coverage #599

Description

@abayomicornelius

Problem

Two keeper-facing bulk-scan getters in reader have zero test coverage anywhere in the repository:

  • get_liquidatable_positions (contracts/reader/src/lib.rs:1108) — scans positions and returns those currently below the liquidation threshold, presumably for a liquidation keeper to consume.
  • get_pending_orders (line 702) — scans and returns orders not yet executed/expired.
grep -rn "get_liquidatable_positions\|get_pending_orders" --include="*.rs" . | grep -v reader/src/lib.rs
# no output

Note get_adl_eligible_positions, the sibling bulk-scan function for ADL, does have direct test coverage (get_adl_eligible_positions_returns_profitable, get_adl_eligible_positions_excludes_losing) — these two functions are the ones that were skipped.

Why it matters

Both are the kind of "keeper polls this list, then acts on each entry" entry point where a filtering bug (returning positions that are actually healthy, or omitting genuinely liquidatable ones; including already-executed orders) has an operational impact — keepers either waste gas on no-op transactions or miss real liquidations/executions — and would not be caught by anything in CI today.

Suggested fix

Mirror the get_adl_eligible_positions tests: seed a mix of liquidatable/healthy positions and pending/executed/expired orders, and assert get_liquidatable_positions/get_pending_orders return exactly the expected subset.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardStellar WaveIssues in the Stellar wave programThird CampaignCampaign: Third CampaignbugSomething isn't workingpriority:mediumsize:s

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions