Closes #1516
Lock in the pagination boundary offset=0, offset==count, limit==MAX_QUERY_LIMIT with explicit unit tests on the pagination module. These three edge cases meet at a single critical point — when the collection size, the requested limit, and the hard cap all equal MAX_QUERY_LIMIT (100) — and were previously covered only incidentally by broader proptests.
Also wires the existing pagination module and its test_queries companion into the crate module tree so they are compiled and exercised by cargo test.
quicklendx-contracts/src/lib.rs— addedmod pagination;+#[cfg(test)] mod test_queries;declarations; changedpaginationfrompubto privatequicklendx-contracts/src/pagination.rs— removedextern crate alloc;andpub const MAX_QUERY_LIMIT(now importscrate::MAX_QUERY_LIMIT)quicklendx-contracts/src/test_queries.rs— added 4 new test functions; updated import to usecrate::MAX_QUERY_LIMIT
-
Wired
pagination.rsinto the crate (mod pagination;atlib.rs:89) — the module was already present on disk but never declared. Made private to avoid exporting a duplicateMAX_QUERY_LIMITconstant that could confuse Soroban's#[contractimpl]spec-generation macro. -
Wired
test_queries.rsas a test module (#[cfg(test)] mod test_queries;atlib.rs:164) — the existing pagination unit tests and escrow query consistency tests are now compiled and run undercargo test. -
Removed
extern crate alloc;frompagination.rs— the crate root (lib.rs:33) already declares it. -
Removed duplicate
pub const MAX_QUERY_LIMITfrompagination.rs—lib.rs:295andinvestment_queries.rs:52each already define it. The third copy (from the newly-wired module) created ambiguity in Soroban's contract-interface macro, causing 19 compilation errors. Nowpagination.rsusescrate::MAX_QUERY_LIMITvia auseimport. -
Added 4 targeted tests (
test_queries.rssection 10) covering the boundary atMAX_QUERY_LIMIT:test_offset_zero_limit_max_on_full_collection_has_no_moretest_offset_zero_limit_max_on_full_collection_returns_alltest_offset_equals_count_limit_max_returns_emptytest_cross_consistency_at_max_query_limit_boundary
Run from quicklendx-contracts/: cargo test -- test_queries
Closes #1516