Skip to content

reader: 12 pagination getters for deposits/withdrawals/orders have zero test coverage #594

Description

@abayomicornelius

Problem

Twelve reader pagination getters have zero test coverage anywhere in the repository:

get_deposit_count, get_deposit_keys, get_account_deposit_count, get_account_deposit_keys, get_withdrawal_count, get_withdrawal_keys, get_account_withdrawal_count, get_account_withdrawal_keys, get_order_count, get_order_keys, get_account_order_count, get_account_order_keys (contracts/reader/src/lib.rs:868-986).

grep -rn "get_deposit_count\|get_account_deposit_keys\|get_withdrawal_count\|get_account_order_keys" --include="*.rs" . | grep -v reader/src/lib.rs
# no output (representative sample of the 12; all follow the same pattern)

Each is a thin proxy that forwards to a data_store set-count/set-range call (e.g. get_deposit_countds.get_address_set_count(&deposit_list_key(&env)), get_account_order_keysds.get_address_set_at(&account_order_list_key(...), &start, &end)). None of the 12 is exercised by any test in contracts/reader/src/lib.rs's own test module or in tests/.

Why it matters

These are the entry points a UI/indexer uses to paginate a user's open orders/deposits/withdrawals. A wrong key derivation, an off-by-one in the start/end range forwarding, or accidentally querying the global list instead of the per-account list would silently return wrong or empty results for real users, and nothing in the test suite would catch it.

Suggested fix

Add tests seeding a few deposits/withdrawals/orders for a couple of different accounts, then asserting each of the 12 getters returns the expected counts/keys, including that the per-account variants correctly exclude other accounts' entries.

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:lowsize:s

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions