100% test coverage for validation.go#379
Conversation
…ing test coverage for validateFileContracts
…teV2FileContractsValidateRevisionClosure
|
Fixing the failing Lint tests now. |
|
@Alrighttt once this is ready make sure to assign PJ, Nate and me as reviewers. |
|
This is already a beast to review, so I will continue with providing 100% test coverage in subsequent pull requests. |
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
n8mgr
left a comment
There was a problem hiding this comment.
There are two duplicate test cases for "storage proof conflicts" you didn't add them, but might as well remove them.
Also this file is pretty large. I wouldn't move any existing tests, but if you added any new ones see if they might make sense in a new file i,.e. validation_txn_test.go. We should move existing tests in a follow-up so the diff isn't polluted.
peterjan
left a comment
There was a problem hiding this comment.
Left some minor comments, LGTM otherwise. I must admit though I didn't read through every line here 😳
consensus/validation_test.go
Outdated
There was a problem hiding this comment.
This case doesn't make sense. Since we're updating this file anyway we might as well take this along.
There was a problem hiding this comment.
What code is this referencing?
There was a problem hiding this comment.
The assertions check whether errString is different from "" and then check whether it's equal.
case test.errString != "" && test.errString == "": line 2273
There was a problem hiding this comment.
I removed it altogether. I believe the intent was to provide a check similar to https://github.com/SiaFoundation/core/blob/8b3a30692fd384e44203bac6f8d81e10341dd1ee/consensus/validation_test.go#L2295C1-L2297C5
|
I addressed all review comments. |
… case; Make each case run as a distinct test and verify that the error message matches
This pull request adds test coverage for any remaining cases within validation.go.
Some tests are non-exhaustive and only add test cases that were previously missing. These are noted with developer comments.