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: verifies the namespace order for each tree node #187

Merged
merged 53 commits into from
May 4, 2023

Conversation

staheri14
Copy link
Contributor

@staheri14 staheri14 commented May 1, 2023

Overview

Closes #129.

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

@staheri14 staheri14 self-assigned this May 1, 2023
@staheri14 staheri14 added the enhancement New feature or request label May 1, 2023
@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Merging #187 (2291c23) into master (9c56d14) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #187      +/-   ##
==========================================
+ Coverage   95.70%   95.73%   +0.03%     
==========================================
  Files           5        5              
  Lines         559      563       +4     
==========================================
+ Hits          535      539       +4     
  Misses         14       14              
  Partials       10       10              
Impacted Files Coverage Δ
hasher.go 97.67% <100.00%> (+0.07%) ⬆️

@staheri14 staheri14 added this to the Mainnet milestone May 3, 2023
@@ -100,18 +100,6 @@ func Test_namespacedTreeHasher_HashNode(t *testing.T) {
concat([]byte{0, 0, 0, 0}, randHash),
concat([]byte{0, 0, 1, 1}, randHash))),
},
// XXX: can this happen in practice? or is this an invalid state?
Copy link
Contributor Author

@staheri14 staheri14 May 3, 2023

Choose a reason for hiding this comment

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

This test case has become invalid as a result of the changes made in this PR, since the minimum ID of the left child i.e., {1,1} is greater than its maximum NID i.e., {0,0}.

}
}

func TestMin(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added these test as the codcov was complaining about the lack of coverage for some part of the min function.

@@ -735,3 +769,73 @@ func Test_MustHashLeaf_Panic(t *testing.T) {
})
}
}

func TestMax(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added these tests for consistency with the tests developed for the min counterpart.

@staheri14 staheri14 marked this pull request as ready for review May 3, 2023 17:59
@staheri14 staheri14 merged commit d0789c6 into master May 4, 2023
@staheri14 staheri14 deleted the verifies-node-namespace-range branch May 4, 2023 23:06
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.

Check ordering of namespace among child nodes in HashNode function
3 participants