-
Notifications
You must be signed in to change notification settings - Fork 214
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
Vesting use case succeeds even if validator is set to True #942
Comments
Can anyone shed any light on this? It's very confusing. |
Are there any negative test cases for this contract i.e. cases where the contract is expected to fail? |
I had a look at it. The We should have add a test on the enchain code itself though, you're right. |
A negative test case would not be a test of the on-chain code directly but an adversarial action that expects the model not to change. |
Both are valid test scenarios actually, you want to check the behaviour of the onchain code and to protect yourself against malicious transaction. |
I really don't see how. The validator only makes sense in the context you intend it to form a functioning contract. A validator by itself is not correct or incorrect, it just is what it is. |
The validator itself is a function, you can use test to specify it and validates that it behaves as specified by the tests. Your validator can respect the specification and the specification can be too weak to ensure properties of a functioning contract, or it can be what is needed. |
The validator is just a content-addressed predicate. The same validator in different contexts can be used for completely different behaviour. There is nothing to say by testing the validator in isolation except to say that it is that predicate. Everything that is testable is defined by what actions you perform and what should the result be. |
We're derailing out of the scope of the issue and it's probably the best place to talk about It (not that I wouldn't like to, but I prefer to keep the comments focused on the initial issue). The issue is tracked. We'll see when and how we'll be able to address it. |
Summary
applying this diff
still makes all the tests for this use case pass
Steps to reproduce the behavior
apply the diff
Actual Result
doesn't work
Expected Result
should work
Describe the approach you would take to fix this
No response
System info
nixos
The text was updated successfully, but these errors were encountered: