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!: handles empty proofs in validateLeafHash and VerifyInclusion #184

Merged
merged 27 commits into from
May 1, 2023

Conversation

staheri14
Copy link
Contributor

@staheri14 staheri14 commented Apr 26, 2023

Overview

Closes #140
The changes made in this PR are considered to be breaking, as they modify the behavior of VerifyInclusion. In the prior version, the VerifyInclusion function would return false for the first test case named "valid empty proof and leaves == empty." of the TestVerifyInclusion_EmptyProofs suite. However, with the changes implemented, an empty proof for an empty set of leaves is now considered a valid proof. As a result, VerifyInclusion now returns true.
cc: @liamsi

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #184 (fc595aa) into master (f05092f) will increase coverage by 1.51%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #184      +/-   ##
==========================================
+ Coverage   94.14%   95.66%   +1.51%     
==========================================
  Files           5        5              
  Lines         547      554       +7     
==========================================
+ Hits          515      530      +15     
+ Misses         18       14       -4     
+ Partials       14       10       -4     
Impacted Files Coverage Δ
proof.go 93.70% <100.00%> (+6.20%) ⬆️

@staheri14 staheri14 self-assigned this Apr 26, 2023
@staheri14 staheri14 added the enhancement New feature or request label Apr 26, 2023
@staheri14 staheri14 changed the title feat: handles empty proofs in validateLeafHash and VerifyInclusion feat!: handles empty proofs in validateLeafHash and VerifyInclusion Apr 27, 2023
@staheri14 staheri14 marked this pull request as ready for review April 27, 2023 21:25
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

LGTM

@staheri14 staheri14 merged commit f403fd9 into master May 1, 2023
@staheri14 staheri14 deleted the panics-in-verifyleafhashes branch May 1, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

verifyLeafHashes function will panic if called from VerifyInclusion function over an empty proof
3 participants