-
Notifications
You must be signed in to change notification settings - Fork 665
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
Automatic checking try_state
hooks in tests
#210
Comments
try_state
hooks in teststry_state
hooks in tests
We could also build a special runtime with |
The external tool could be chopsticks. AcalaNetwork/chopsticks#70 |
This is exactly what |
Then this issue would be solved? |
This issue is for checking the |
Ahh now I get your comment "on every 100th storage modification". Hmm. This could be breaking stuff as an invariant is only required to hold after a function has finished or even multiple. I think the idea to check try_state after each test is much better. |
paritytech/substrate#13563 waiting to see the SDK team close this sir @bkchr :D |
For tests, we don't have a good way to do this. Perhaps someday we can create a framework for building test setup that does this for us. Think Also, as I am grooming issues today, if we have #261, then we can automatically call Lastly, perhaps we can leverage |
Currently we have this setup of a
try_state
hook per pallet which can check storage invariants.This is very good, but the hook has to be invoked manually in tests or placed at the end once in a modified
new_test_ext
.It would be nice if we could check these invariants more often. For example on every 100th storage modification.
One way to achieve this could be to hook into the storage functions of
TestExternalities
and register a post-modify hook which can then be set totry_state
. Do you think that would work?The text was updated successfully, but these errors were encountered: