-
Notifications
You must be signed in to change notification settings - Fork 27
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
tests(verification): implement tests to improve refactor reliability #824
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #824 +/- ##
==========================================
+ Coverage 84.55% 84.56% +0.01%
==========================================
Files 269 269
Lines 22234 22234
Branches 3397 3397
==========================================
+ Hits 18799 18802 +3
+ Misses 2765 2762 -3
Partials 670 670 ☔ View full report in Codecov by Sentry. |
jansegre
previously approved these changes
Oct 23, 2023
msbrogli
requested changes
Oct 23, 2023
msbrogli
reviewed
Oct 24, 2023
msbrogli
requested changes
Oct 24, 2023
msbrogli
approved these changes
Oct 24, 2023
408b1d1
to
8e2c1c0
Compare
jansegre
approved these changes
Oct 24, 2023
8e2c1c0
to
0ed7e3f
Compare
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Improve the reliability of the "move verification" refactors, starting from #797.
This PR aims to assert that each verification method is called when it is supposed to be called, specially considering the inheritance hierarchy of vertices. New tests are implemented for
verify_basic()
,verify_without_storage()
, andverify()
, for each one of the 4 vertex types, totaling 12 new tests.For the root types
Block
andTransaction
, the tests are straightforward. For the derived typesMergeMinedBlock
andTokenCreationTransaction
, the tests are the same as for their parent types, but with the modification considering their custom methods. The only modifications are the following:MergeMinedBlock
:Block.verify_without_storage()
is overridden to add the customverify_aux_pow()
. This inflicts changes in theverify_without_storage()
andverify()
tests.TokenCreationTransaction
:Transaction.verify_sum()
is overridden to be substituted by a customverify_sum()
. This inflicts no changes in tests.TokenCreationTransaction.verify_token_info()
is added toverify()
. This inflicts changes in theverify()
test.Acceptance Criteria
Checklist
master
, confirm this code is production-ready and can be included in future releases as soon as it gets merged