Skip to content

test(settlement): add 1000-payment max-capacity stress suite#1789

Open
AbuJulaybeeb wants to merge 1 commit into
QuickLendX:mainfrom
AbuJulaybeeb:test/settlement-capacity-stress
Open

test(settlement): add 1000-payment max-capacity stress suite#1789
AbuJulaybeeb wants to merge 1 commit into
QuickLendX:mainfrom
AbuJulaybeeb:test/settlement-capacity-stress

Conversation

@AbuJulaybeeb

Copy link
Copy Markdown
Contributor

What was done:

  • Added test_settlement_capacity_stress.rs to validate maximum payment capacity of the record_payment logic.
  • Included bounds checks ensuring the discrete inline payment history correctly truncates at MAX_INLINE_PAYMENT_HISTORY (32) while tracking the true count up to MAX_PAYMENT_COUNT (1,000).
  • Confirmed that the 1001st partial payment correctly errors with OperationNotAllowed.
  • Replicated page retrieval iterations checking get_payment_records and asserting that records paginate perfectly up to 1000 items with zero duplicates and gaps, terminating with an empty list.
    Why it was done:
  • To secure the bounds of Soroban footprint limits per settlement block. This proves the accounting invariants (total_paid <= total_due) and final auto-settlement resolution persist correctly without memory overflows or unbounded growth exceptions.
    How it was verified:
  • Fired cargo test -p quicklendx-contracts test_settlement_capacity_stress to ensure test assertions pass cleanly under simulation.
  • cargo clippy passed cleanly ensuring standard protocol style.
    Closes Add 1000-payment max-capacity stress test for record_payment and paginated get_payment_records #1300

@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@AbuJulaybeeb Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 1000-payment max-capacity stress test for record_payment and paginated get_payment_records

1 participant