hathor-core icon indicating copy to clipboard operation
hathor-core copied to clipboard

refactor(vertex-handler): modularize methods [part 2/2]

Open glevco opened this issue 1 year ago • 1 comments

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() to on_new_vertex().
  • Break on_new_vertex() into modularized methods, _validate_vertex(), _save_and_run_consensus(), and _post_consensus() (renamed from tx_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

glevco avatar Apr 02 '24 16:04 glevco

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.

codecov[bot] avatar Apr 02 '24 18:04 codecov[bot]