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

chainhash: JSON marshal hash as string #1932

Merged
merged 1 commit into from
Dec 5, 2022

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented Dec 2, 2022

This PR adds a MarshalJSON() method to chainhash.Hash. As a result, when serializing structures as JSON, a chain hash will be represented as its String() value.

This change simplifies the JSON serialization of block and block header.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3604570378

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 55.172%

Files with Coverage Reduction New Missed Lines %
connmgr/connmanager.go 2 86.07%
Totals Coverage Status
Change from base Build 3516278895: 0.02%
Covered Lines: 26568
Relevant Lines: 48155

💛 - Coveralls

@guggero guggero merged commit 718d268 into btcsuite:master Dec 5, 2022
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.

4 participants