Skip to content
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
merged 1 commit into from
Oct 24, 2023

Conversation

glevco
Copy link
Contributor

@glevco glevco commented Oct 20, 2023

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(), and verify(), for each one of the 4 vertex types, totaling 12 new tests.

For the root types Block and Transaction, the tests are straightforward. For the derived types MergeMinedBlock and TokenCreationTransaction, the tests are the same as for their parent types, but with the modification considering their custom methods. The only modifications are the following:

  • For MergeMinedBlock:
    • The Block.verify_without_storage() is overridden to add the custom verify_aux_pow(). This inflicts changes in the verify_without_storage() and verify() tests.
  • For TokenCreationTransaction:
    • Transaction.verify_sum() is overridden to be substituted by a custom verify_sum(). This inflicts no changes in tests.
    • The TokenCreationTransaction.verify_token_info() is added to verify(). This inflicts changes in the verify() test.

Acceptance Criteria

  • Implement verification tests.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco added the tests label Oct 20, 2023
@glevco glevco self-assigned this Oct 20, 2023
@glevco glevco marked this pull request as ready for review October 20, 2023 22:34
@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d8e1964) 84.55% compared to head (0ed7e3f) 84.56%.

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              

see 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

jansegre
jansegre previously approved these changes Oct 23, 2023
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
tests/tx/test_verification.py Show resolved Hide resolved
@glevco glevco force-pushed the tests/verification-refactor branch from 408b1d1 to 8e2c1c0 Compare October 24, 2023 17:12
@glevco glevco force-pushed the tests/verification-refactor branch from 8e2c1c0 to 0ed7e3f Compare October 24, 2023 17:17
@glevco glevco merged commit 86e908c into master Oct 24, 2023
@glevco glevco deleted the tests/verification-refactor branch October 24, 2023 19:24
@jansegre jansegre mentioned this pull request Nov 13, 2023
2 tasks
This was referenced Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants