header: Extract `Head` method into separate `Head` interface, make `Syncer` implement it
This PR extracts Head() method into a separate interface and makes Syncer implement it.
Prerequisite for #933 to restrict the State service's access to headers to the only methods it really needs (Head).
Codecov Report
Merging #978 (12aa560) into main (5859938) will increase coverage by
0.23%. The diff coverage is81.81%.
@@ Coverage Diff @@
## main #978 +/- ##
==========================================
+ Coverage 58.56% 58.79% +0.23%
==========================================
Files 131 132 +1
Lines 7766 7985 +219
==========================================
+ Hits 4548 4695 +147
- Misses 2745 2814 +69
- Partials 473 476 +3
| Impacted Files | Coverage Δ | |
|---|---|---|
| header/sync/sync.go | 69.16% <77.77%> (+3.66%) |
:arrow_up: |
| header/verify.go | 82.97% <100.00%> (+1.58%) |
:arrow_up: |
| node/services/service.go | 80.66% <100.00%> (-2.79%) |
:arrow_down: |
| node/settings.go | 36.36% <100.00%> (+0.80%) |
:arrow_up: |
| node/testing.go | 100.00% <100.00%> (ø) |
|
| params/network.go | 57.14% <100.00%> (+17.14%) |
:arrow_up: |
| cmd/flags_misc.go | 42.59% <0.00%> (-11.80%) |
:arrow_down: |
| cmd/env.go | 76.47% <0.00%> (ø) |
|
| ... and 10 more |
Help us with your feedback. Take ten seconds to tell us how you rate us.
Implementing the Head method for Syncer is the original goal of this PR. However, some internal logic has to be changed to allow this, and these logic changes are now extracted into https://github.com/celestiaorg/celestia-node/pull/990. This PR should rebase on top of it(after or before merge) and simply implement the Head method
Already implemented in main