celestiaorg / smt

A Go library that implements a Sparse Merkle tree for a key-value map.
https://godoc.org/github.com/celestiaorg/smt
MIT License
138 stars 53 forks source link

Error handling before logic in HasDescend #50

Closed adlerjohn closed 3 years ago

adlerjohn commented 3 years ago

Fixes #48.

Do error handling separately and before the function's logic. This avoids (true, non-nil) return value.

codecov-commenter commented 3 years ago

Codecov Report

Merging #50 (e415b7d) into master (2c90766) will decrease coverage by 0.36%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
- Coverage   86.05%   85.68%   -0.37%     
==========================================
  Files           6        6              
  Lines         466      468       +2     
==========================================
  Hits          401      401              
- Misses         37       39       +2     
  Partials       28       28              
Impacted Files Coverage Δ
deepsubtree.go 61.11% <0.00%> (-2.36%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2c90766...e415b7d. Read the comment docs.