-
Notifications
You must be signed in to change notification settings - Fork 712
Proptests for Clarity 4 functions #6606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proptests for Clarity 4 functions #6606
Conversation
If the body hits a runtime error, that should be passed up before bothering to check the allowances (and the changes should be rolled back).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great start for property testing restrict-asssets.
I think there's kind of two (possibly three?) things missing though.
First, I think you'll want a way to generate "allowable" snippets. As in, generate a stx-transfer and the necessary allowance to add to the snippet. Then, you could proptest that the execution is "okay" in those cases.
Second, I think we also want to be able to mix in multiple asset snippets. Basically, we'd want to test something like the property "execution is identical with and without restrict-assets when all asset snippets have assets included in restrict assets", but also "execution is disallowed when any asset snippet is included without a matching asset allowance"
Finally, I think we want to test with a different tx-sender than just the transient one as well.
|
@aaronb-stacks I've addressed those points and added some other tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
@aaronb-stacks I reverted that "optimization" related to our discussion about handling short returns. |
3e7ecdb
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (48.43%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## develop #6606 +/- ##
============================================
- Coverage 79.86% 48.43% -31.43%
============================================
Files 573 574 +1
Lines 352853 354916 +2063
============================================
- Hits 281798 171913 -109885
- Misses 71055 183003 +111948
... and 456 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Add some framework for property testing the new functions.