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

Improve error handling when computing PMMR roots #2988

Merged
merged 3 commits into from
Aug 9, 2019

Conversation

j01tz
Copy link
Member

@j01tz j01tz commented Aug 8, 2019

This PR attempts to better recover if computing a corrupted or otherwise invalid PMMR root:

  • Replace expect with ok_or_else when computing the root() of a PMMR
    • Returns a Result instead of panicking
  • Update relevant function signatures and callers to handle a Result
  • Add unwrap() in tests that expect a Hash instead of a Result from PMMR root()

@antiochp antiochp self-requested a review August 9, 2019 13:30
Copy link
Member

@antiochp antiochp left a comment

Choose a reason for hiding this comment

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

👍

@antiochp antiochp merged commit d220410 into mimblewimble:master Aug 9, 2019
@j01tz j01tz deleted the research-12-a branch August 9, 2019 19:26
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.

3 participants