Skip to content

[Testing] Setup Property-Based Testing for Contract Invariants (#99)#139

Merged
ayomideadeniran merged 1 commit intoSoroLabs:mainfrom
AdityaK9822:feature/issue-99-proptest
Mar 29, 2026
Merged

[Testing] Setup Property-Based Testing for Contract Invariants (#99)#139
ayomideadeniran merged 1 commit intoSoroLabs:mainfrom
AdityaK9822:feature/issue-99-proptest

Conversation

@AdityaK9822
Copy link
Copy Markdown
Contributor

Closes #99

This PR integrates the proptest framework to ensure our critical task invariants consistently hold under sequences of randomized actions.

Changes Included:

  • Added proptest = "1.5.0" into [dev-dependencies] for contract.
  • Created a robust property testing module (contract/src/proptest.rs) executing hundreds of random permutations for each configured property.
  • Included validations for:
    • Task Registration/Creation: Random parameter coverage scaling limits ensuring no edge-case overflows trap new tasks.
    • State Transitions: Continuous sequences varying pause/resume logic ensuring bounds function properly when hit recursively.
    • Financial Balances: Mocked token behavior confirming randomized deposit/withdraw sequences track mathematically identically against internal state values rejecting all insufficient withdrawal bounds securely.

ETA Completed: Under 2 days (as required).

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@AdityaK9822 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

@ayomideadeniran
Copy link
Copy Markdown
Contributor

Pr under review.

@ayomideadeniran ayomideadeniran merged commit f69751c into SoroLabs:main Mar 29, 2026
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.

[Testing] Set up Property-Based Testing for Contract Invariants

2 participants