-
Notifications
You must be signed in to change notification settings - Fork 79
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
ForeignInvestments: Unitary tests & fuzzer #1509
Conversation
5075dc1
to
8012557
Compare
85f8aaf
to
46e922a
Compare
@wischli I've needed to tweak a bit the I missed the fact that auto implementations for any Tell me WDYT and if you prefer this change in your PR |
I suppose it will make maintaining sync between this PR and mine much easier for you? In that case, I would add to to mine as well. Otherwise, we can also leave it untouched in #1473. |
If the intention is to merge your PR today, and no changes there are expected, we can leave it as it is. If you find that you need to make some "big" change, then I think we can put this change just before. By now, we can leave it here 👍🏻 |
Just as a thought (mostly to myself). Given the number of state combinations we have, maybe the best way to test this is to extract the invariant laws of this (i.e. the amount of money in the system must remain the same, independently of how many swaps are done) and create a fuzzier ensuring the invariant is always fulfilled for all combinations. |
ddeff07
to
ee83285
Compare
e2f6041
to
48229cc
Compare
48229cc
to
fb10df2
Compare
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.
Super clean and elegant code as always! Thanks for complementing the existing integration tests with valuable fuzz tests plus providing mock skeletons.
I have three super minor nits which can be ignored. We could merge this PR right now or wait until RedeemState
fuzzing is implemented. Totally fine with doing this in a subsequent PR.
My first intention was to create individual tests using mocks, but I realized that testing for all transitions could take me months, because I need to evaluate each parameter of each mocked call, and most of what I would check is already covered by integration tests. Anyway, it still can be seen as a future work (or used by other pallets), that's why I leave the mock skeletons there. |
Awesome stuff @lemunozm! |
Updated with last changes of #1556. Should be ready to be merged now |
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.
Re-approving!
Description
Unitary tests for foreign investments
Changes and Descriptions
UTs with mocks.It seems like this path is never-ending and collides with integration tests.UTs for states.It seems like this path is never-ending and very difficult to maintain if future changes are made.