Skip to content

Add regression test that list_fee_waived_anchors' pagination matches list_anchors' skip-without-counting behavior #147

Description

@Jagadeeshftw

📌 Description

list_fee_waived_anchors(start, limit) explicitly mirrors list_anchors's pagination pattern per its own doc comment, additionally filtering on is_fee_waived. There is no existing test confirming the two functions produce consistent, comparable pagination results (e.g. that a start index refers to the same underlying AnchorList position in both, and that both correctly skip non-matching/deregistered entries without consuming limit slots) when run against the identical underlying anchor list.

🧩 Requirements and context

  • Add a regression test with a mix of registered, deregistered, waived, and non-waived anchors in AnchorList, then compare list_anchors(start, limit) and list_fee_waived_anchors(start, limit) outputs for consistency with independently-computed expected subsets.
  • Cover a start value that lands in the middle of a run of skipped (deregistered or non-waived) entries for both functions.
  • Assert both functions never include more than limit entries and never miscount skipped entries toward that limit.

🛠️ Suggested execution

  • Add the comparative test to src/test.rs, building a shared anchor-list fixture used by both assertions.
  • No production code changes expected — this closes a cross-function consistency test gap.
  • Cross-reference the existing 'pagination edge-case regression tests across every list_* entrypoint' issue in this repo's backlog to avoid duplicating its exact scenarios; this issue is specifically about cross-function consistency, not single-function edge cases.

✅ Acceptance criteria

  • A regression test confirms list_anchors and list_fee_waived_anchors behave consistently against the same underlying AnchorList fixture.
  • Both functions correctly skip non-matching entries without counting them toward limit.
  • The test would catch a future divergence between the two functions' pagination semantics.

🔒 Security notes

Divergent pagination semantics between two functions documented as mirroring each other could mislead an off-chain client that assumes identical start/limit behavior, silently dropping or duplicating anchors in a paginated UI.

📋 Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial Campaign | FWC26GrantFox official campaign issuesmart-contractSoroban/Rust smart contract worktestingTests and coverage

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions