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

refactor(verification): move verification methods signatures [part 2/5] #797

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

glevco
Copy link
Contributor

@glevco glevco commented Sep 29, 2023

Depends on #796

Motivation

This is the second PR in a 5-part series of PRs that completely move verification-related code out of the vertex model classes.

The objective in this PR is to copy all verification methods signatures from the vertex model classes to each respective Verifier class. The new methods simply call the original methods, effectively providing a new interface for existing implementations.

By doing this, we can update all callers of any verification method to use the new Verifier methods, while not touching the original model classes. This is the scaffolding necessary to actually move method implementations in the following PRs.

Acceptance Criteria

  • Copy all existing verification methods to each respective Verifier class. The implementation is simply a forward to the original method implemented by each vertex model class.
  • Implement VerificationService.verify_without_storage().
  • Update every usage of any verification method to use the Verifier method, instead of the original model method.

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 self-assigned this Sep 29, 2023
@glevco glevco changed the title refactor(verification): move verification methods signatures refactor(verification): move verification methods signatures [part 2] Sep 29, 2023
@glevco glevco changed the title refactor(verification): move verification methods signatures [part 2] refactor(verification): move verification methods signatures [part 2/5] Sep 29, 2023
@glevco glevco marked this pull request as ready for review September 29, 2023 20:46
@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (d8e1964) 84.55% compared to head (24de4ef) 84.56%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #797      +/-   ##
==========================================
+ Coverage   84.55%   84.56%   +0.01%     
==========================================
  Files         269      269              
  Lines       22234    22308      +74     
  Branches     3397     3401       +4     
==========================================
+ Hits        18799    18865      +66     
- Misses       2765     2771       +6     
- Partials      670      672       +2     
Files Coverage Δ
hathor/stratum/stratum.py 69.32% <100.00%> (+0.12%) ⬆️
hathor/transaction/resources/create_tx.py 92.59% <100.00%> (ø)
hathor/verification/merge_mined_block_verifier.py 100.00% <100.00%> (ø)
...erification/token_creation_transaction_verifier.py 100.00% <100.00%> (ø)
hathor/verification/transaction_verifier.py 93.87% <97.05%> (+2.57%) ⬆️
hathor/verification/vertex_verifier.py 94.11% <91.66%> (-5.89%) ⬇️
hathor/verification/block_verifier.py 93.54% <89.47%> (-6.46%) ⬇️
hathor/verification/verification_service.py 90.21% <86.66%> (+7.10%) ⬆️

... and 4 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 3, 2023
@glevco glevco force-pushed the refactor/move-verification/create-verifiers branch from 8f2d608 to 462f90f Compare October 9, 2023 19:26
@glevco glevco force-pushed the refactor/move-verification/method-signatures branch from 13398a6 to f407055 Compare October 9, 2023 19:50
@glevco glevco force-pushed the refactor/move-verification/create-verifiers branch from 462f90f to f35ffce Compare October 9, 2023 23:57
@glevco glevco force-pushed the refactor/move-verification/method-signatures branch from f407055 to 5b92821 Compare October 10, 2023 02:29
@glevco glevco force-pushed the refactor/move-verification/create-verifiers branch from d43178a to 1cb8d78 Compare October 10, 2023 18:57
Base automatically changed from refactor/move-verification/create-verifiers to master October 10, 2023 20:33
@msbrogli msbrogli dismissed jansegre’s stale review October 10, 2023 20:33

The base branch was changed.

@glevco glevco force-pushed the refactor/move-verification/method-signatures branch 2 times, most recently from 160989e to 2c4f61e Compare October 11, 2023 17:36
tests/tx/test_genesis.py Outdated Show resolved Hide resolved
tests/wallet/test_wallet_hd.py Outdated Show resolved Hide resolved
tests/wallet/test_wallet_hd.py Outdated Show resolved Hide resolved
hathor/verification/block_verifier.py Outdated Show resolved Hide resolved
hathor/verification/block_verifier.py Outdated Show resolved Hide resolved
hathor/verification/transaction_verifier.py Outdated Show resolved Hide resolved
hathor/verification/transaction_verifier.py Outdated Show resolved Hide resolved
hathor/verification/transaction_verifier.py Outdated Show resolved Hide resolved
hathor/verification/transaction_verifier.py Outdated Show resolved Hide resolved
hathor/verification/vertex_verifier.py Outdated Show resolved Hide resolved
@glevco glevco force-pushed the refactor/move-verification/method-signatures branch from 2c4f61e to 105e059 Compare October 17, 2023 20:50
tests/tx/test_genesis.py Outdated Show resolved Hide resolved
tests/wallet/test_wallet_hd.py Outdated Show resolved Hide resolved
tests/wallet/test_wallet_hd.py Outdated Show resolved Hide resolved
hathor/verification/block_verifier.py Outdated Show resolved Hide resolved
hathor/verification/transaction_verifier.py Outdated Show resolved Hide resolved
hathor/verification/transaction_verifier.py Outdated Show resolved Hide resolved
hathor/verification/transaction_verifier.py Outdated Show resolved Hide resolved
hathor/verification/transaction_verifier.py Outdated Show resolved Hide resolved
hathor/verification/vertex_verifier.py Outdated Show resolved Hide resolved
@glevco glevco force-pushed the refactor/move-verification/method-signatures branch from 105e059 to 111621e Compare October 19, 2023 20:29
@glevco glevco force-pushed the refactor/move-verification/method-signatures branch from 111621e to 24de4ef Compare October 24, 2023 19:28
@glevco glevco merged commit 3365e4b into master Oct 24, 2023
9 checks passed
@glevco glevco deleted the refactor/move-verification/method-signatures branch October 24, 2023 21:23
@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