btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.11k stars 2.32k forks source link

chainhash: JSON marshal hash as string #1932

Closed ffranr closed 1 year ago

ffranr commented 1 year ago

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 commented 1 year ago

Pull Request Test Coverage Report for Build 3604570378


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

💛 - Coveralls