Skip to content

Improve error handling when computing PMMR roots#2988

Merged
antiochp merged 3 commits into
mimblewimble:masterfrom
j01tz:research-12-a
Aug 9, 2019
Merged

Improve error handling when computing PMMR roots#2988
antiochp merged 3 commits into
mimblewimble:masterfrom
j01tz:research-12-a

Conversation

@j01tz
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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