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

types: Write test for header.Hash() #2676

Closed
ebuchman opened this issue Oct 19, 2018 · 1 comment · Fixed by #4052
Closed

types: Write test for header.Hash() #2676

ebuchman opened this issue Oct 19, 2018 · 1 comment · Fixed by #4052
Labels
good first issue Contributions Welcome!! T:test Type: Tests that need love
Milestone

Comments

@ebuchman
Copy link
Contributor

In #2670 we changes the header.Hash to use SimpleHashFromByteSlices instead of SimpleHashFromMap, since the former is a simpler and more straightforward design with less dependencies (eg. no need to build kvpairs or sort them).

We should write a test for the header.Hash. We can have both:

  • a test using reflect to ensure the hash is computed with the fields in the right order
  • a hardcoded test with actual values for the header and actual hash output that can serve as test vectors for others verifying header hashes
@ebuchman ebuchman added help wanted T:test Type: Tests that need love good first issue Contributions Welcome!! labels Oct 19, 2018
@ebuchman ebuchman added this to the v1.0 milestone Oct 19, 2018
@ebuchman
Copy link
Contributor Author

Note any hard-coded values will be impacted by the changes in #2713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Contributions Welcome!! T:test Type: Tests that need love
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants