celestiaorg / go-header

Go library with all the services needed to request, sync and store blockchain headers.
Apache License 2.0
19 stars 18 forks source link

fix: ensure header.Validate is called by the lib #89

Closed Wondertan closed 1 year ago

Wondertan commented 1 year ago

Header implementations should not call Validate themselves as the lib now controls it.

Additionally, we unify the response processing code and Header constructor.

Closes #78 Based on #88

codecov-commenter commented 1 year ago

Codecov Report

Merging #89 (c51aa1e) into main (e500905) will decrease coverage by 0.08%. The diff coverage is 67.74%.

@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
- Coverage   68.34%   68.27%   -0.08%     
==========================================
  Files          36       37       +1     
  Lines        2903     2909       +6     
==========================================
+ Hits         1984     1986       +2     
- Misses        768      771       +3     
- Partials      151      152       +1     
Files Changed Coverage Δ
p2p/subscriber.go 44.64% <45.45%> (-5.36%) :arrow_down:
p2p/exchange.go 85.65% <62.50%> (+1.97%) :arrow_up:
p2p/session.go 91.23% <70.96%> (-1.24%) :arrow_down:
store/store.go 67.91% <75.00%> (-0.11%) :arrow_down:
header.go 100.00% <100.00%> (ø)
store/init.go 54.54% <100.00%> (ø)

... and 2 files with indirect coverage changes