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

feat: introduce rsmt2d.ErrTooFewShards #201

Closed
wants to merge 3 commits into from

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Jun 28, 2023

Closes #199 but doesn't remove rebuiltShares
Closes #200 via Option A

@rootulp rootulp self-assigned this Jun 28, 2023
@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #201 (81d1bff) into master (2557620) will decrease coverage by 0.37%.
The diff coverage is 76.92%.

@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
- Coverage   80.80%   80.43%   -0.37%     
==========================================
  Files           7        7              
  Lines         500      506       +6     
==========================================
+ Hits          404      407       +3     
- Misses         57       59       +2     
- Partials       39       40       +1     
Impacted Files Coverage Δ
codecs.go 50.00% <ø> (ø)
leopard.go 75.00% <60.00%> (-2.78%) ⬇️
extendeddatacrossword.go 70.71% <87.50%> (-0.24%) ⬇️

staheri14
staheri14 previously approved these changes Jun 28, 2023
Copy link
Contributor

@staheri14 staheri14 left a comment

Choose a reason for hiding this comment

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

LGTM!

@rootulp
Copy link
Collaborator Author

rootulp commented Jun 29, 2023

On second thought, I think it may help readability to isolate the error handling logic inside rebuildShares so I'm going to attempt to clean this up.

@rootulp rootulp marked this pull request as draft June 29, 2023 14:17
@rootulp rootulp changed the title refactor: remove rebuildShares feat: introduce rsmt2d.ErrTooFewShards Jun 29, 2023
return nil, ErrTooFewShards
}
if err != nil {
return nil, err
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm finding it difficult to cover this line via unit tests by triggering an error in Reconstruct that isn't ErrTooFewShards or ErrShardNoData. Given this observation, this PR seems low priority.

@rootulp
Copy link
Collaborator Author

rootulp commented Jun 30, 2023

Closing b/c #201 (comment)

@rootulp rootulp closed this Jun 30, 2023
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.

Decode returns an error when failed to reconstruct Consider removing rebuildShares
2 participants