hathor-core
hathor-core copied to clipboard
refactor(vertex-handler): modularize methods [part 2/2]
Depends on https://github.com/HathorNetwork/hathor-core/pull/987
Motivation
Modularize on_new_tx() as a prerequisite for the upcoming changes related to multiprocess verification, in order to create a new aysnc on_new_tx() (we should be able to duplicate the method without copying all code).
Acceptance Criteria
- Rename
VertexHandler.on_new_tx()toon_new_vertex(). - Break
on_new_vertex()into modularized methods,_validate_vertex(),_save_and_run_consensus(), and_post_consensus()(renamed fromtx_fully_validated()). - No behavior should change, only a couple unnecessary assertions were removed.
Checklist
- [x] 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
Codecov Report
Attention: Patch coverage is 92.50000% with 3 lines in your changes are missing coverage. Please review.
Project coverage is 84.90%. Comparing base (
5d3b757) to head (e09d336).
| Files | Patch % | Lines |
|---|---|---|
| hathor/vertex_handler/vertex_handler.py | 92.30% | 2 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #988 +/- ##
==========================================
- Coverage 84.94% 84.90% -0.05%
==========================================
Files 298 298
Lines 22928 22932 +4
Branches 3464 3465 +1
==========================================
- Hits 19476 19470 -6
- Misses 2767 2772 +5
- Partials 685 690 +5
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.