Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove panic from IntervalDigestFromBytes #22

Merged
merged 1 commit into from
Mar 14, 2021

Conversation

Wondertan
Copy link
Member

Fixes #20

@Wondertan Wondertan requested a review from liamsi March 12, 2021 16:07
@Wondertan Wondertan self-assigned this Mar 12, 2021
@@ -220,3 +220,13 @@ func nextSubtreeSize(start, end uint64) int {
}
return 1 << uint(ideal)
}

// mustIntervalDigestFromBytes optimistially converts bytes to IntervalDigest or panics
func mustIntervalDigestFromBytes(idlen namespace.IDSize, bytes []byte) namespace.IntervalDigest {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we need to export this

@codecov
Copy link

codecov bot commented Mar 12, 2021

Codecov Report

Merging #22 (a5c8085) into master (b22170d) will decrease coverage by 0.57%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
- Coverage   95.39%   94.82%   -0.58%     
==========================================
  Files           7        7              
  Lines         304      309       +5     
==========================================
+ Hits          290      293       +3     
- Misses         10       11       +1     
- Partials        4        5       +1     
Impacted Files Coverage Δ
proof.go 97.05% <66.66%> (-2.95%) ⬇️
namespace/digest.go 100.00% <100.00%> (ø)
nmt.go 92.95% <100.00%> (ø)

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 b22170d...a5c8085. Read the comment docs.

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Wondertan 🙏🏼

Before including this change in lazyledger-core, we should tag another release.

@Wondertan
Copy link
Member Author

@liamsi, ok will do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Work around the panic thrown by IntervalDigestFromBytes
2 participants